summaryrefslogtreecommitdiff
path: root/tests/ajax
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-03-26 11:54:47 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-03-26 11:54:47 +0100
commit78654369e918126c137b5aa4ba709a7bc0a27b43 (patch)
tree32412d16ff11cc46394a3615417b53f1f5d04c2e /tests/ajax
parent0f9d06c6644f634b436549f0d5e56fc96ebd361c (diff)
downloadsemanticscuttle-78654369e918126c137b5aa4ba709a7bc0a27b43.tar.gz
semanticscuttle-78654369e918126c137b5aa4ba709a7bc0a27b43.tar.bz2
test for beginsWith parameter and a bugfix :)
Diffstat (limited to 'tests/ajax')
-rw-r--r--tests/ajax/GetContactTagsTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ajax/GetContactTagsTest.php b/tests/ajax/GetContactTagsTest.php
index 757dce9..6e40444 100644
--- a/tests/ajax/GetContactTagsTest.php
+++ b/tests/ajax/GetContactTagsTest.php
@@ -71,6 +71,23 @@ class ajax_GetContactTagsTest extends TestBaseApi
$this->assertContains('public2', $data);
$this->assertContains('user2tag', $data);
}
+
+ public function testParameterBeginsWith()
+ {
+ list($req, $uId) = $this->getLoggedInRequest('?beginsWith=bar');
+ $this->addBookmark($uId, null, 0, array('foobar', 'barmann'));
+
+ $res = $req->send();
+ $this->assertEquals(200, $res->getStatus());
+ $this->assertEquals(
+ 'application/json; charset=utf-8',
+ $res->getHeader('content-type')
+ );
+ $data = json_decode($res->getBody());
+ $this->assertInternalType('array', $data);
+ $this->assertEquals(1, count($data));
+ $this->assertContains('barmann', $data);
+ }
}