aboutsummaryrefslogtreecommitdiff
path: root/tests/ajax
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-03-26 13:55:46 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-03-26 13:55:46 +0100
commit0935c984991defbc3b7d8549ffa020371d5688f3 (patch)
tree044c2bccf00209d512e22434498bdfb41bd7e2c2 /tests/ajax
parent78654369e918126c137b5aa4ba709a7bc0a27b43 (diff)
downloadsemanticscuttle-0935c984991defbc3b7d8549ffa020371d5688f3.tar.gz
semanticscuttle-0935c984991defbc3b7d8549ffa020371d5688f3.tar.bz2
test the limit parameter
Diffstat (limited to 'tests/ajax')
-rw-r--r--tests/ajax/GetContactTagsTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ajax/GetContactTagsTest.php b/tests/ajax/GetContactTagsTest.php
index 6e40444..682173b 100644
--- a/tests/ajax/GetContactTagsTest.php
+++ b/tests/ajax/GetContactTagsTest.php
@@ -88,6 +88,30 @@ class ajax_GetContactTagsTest extends TestBaseApi
$this->assertEquals(1, count($data));
$this->assertContains('barmann', $data);
}
+
+ public function testParameterLimit()
+ {
+ list($req, $uId) = $this->getLoggedInRequest('?limit=2');
+ $this->addBookmark($uId, null, 0, array('foo', 'bar', 'baz', 'omg'));
+
+ $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(2, count($data));
+
+ $req2 = $this->getRequest('?limit=3');
+ $req2->setCookieJar($req->getCookieJar());
+ $res = $req2->send();
+ $this->assertEquals(200, $res->getStatus());
+ $data = json_decode($res->getBody());
+ $this->assertInternalType('array', $data);
+ $this->assertEquals(3, count($data));
+ }
}