public function testTagDiacritics() { $data = API::createItem("book", ["tags" => [["tag" => "ëtest"]]], $this, 'jsonData'); $version = $data['version']; // Add 'etest', without accent $data['tags'] = [["tag" => "ëtest"], ["tag" => "etest"]]; $response = API::postItem($data); $this->assert200($response); $this->assert200ForObject($response); // Item version should be one greater than last update $data = API::getItem($data['key'], $this, 'json')['data']; $this->assertEquals($version + 1, $data['version']); $this->assertCount(2, $data['tags']); $this->assertContains(["tag" => "ëtest"], $data['tags']); $this->assertContains(["tag" => "etest"], $data['tags']); }
public function testSaveUnchangedSanitizedNote() { $json = API::createNoteItem("<span >Foo</span>", false, $this, 'json'); $response = API::postItem($json['data']); $json = API::getJSONFromResponse($response); $this->assertArrayHasKey(0, $json['unchanged']); }