From 0f9d06c6644f634b436549f0d5e56fc96ebd361c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 26 Mar 2011 10:00:18 +0100 Subject: first working unittest for ajax/getcontacttags with login! --- tests/ajax/GetContactTagsTest.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tests/ajax') diff --git a/tests/ajax/GetContactTagsTest.php b/tests/ajax/GetContactTagsTest.php index 7f46888..757dce9 100644 --- a/tests/ajax/GetContactTagsTest.php +++ b/tests/ajax/GetContactTagsTest.php @@ -47,13 +47,17 @@ class ajax_GetContactTagsTest extends TestBaseApi } - public function testUserLoggedIn() + public function testUserLoggedInWatchlist() { - list($req, $uId) = $this->getAuthRequest(); - $this->addBookmark($uId, null, 0, array('public')); - $this->addBookmark($uId, null, 1, array('shared')); - $this->addBookmark($uId, null, 2, array('private')); - + list($req, $uId) = $this->getLoggedInRequest(); + $this->addBookmark($uId, null, 0, array('public', 'public2')); + + $user2 = $this->addUser(); + $this->us->setCurrentUserId($uId); + $this->us->setWatchStatus($user2); + //uId watches user2 now + $this->addBookmark($user2, null, 0, array('user2tag')); + $res = $req->send(); $this->assertEquals(200, $res->getStatus()); $this->assertEquals( @@ -64,8 +68,8 @@ class ajax_GetContactTagsTest extends TestBaseApi $this->assertInternalType('array', $data); $this->assertEquals(3, count($data)); $this->assertContains('public', $data); - $this->assertContains('shared', $data); - $this->assertContains('private', $data); + $this->assertContains('public2', $data); + $this->assertContains('user2tag', $data); } } -- cgit v1.2.3