service = new JsonDbOpensocialService(); } /** * Cleans up the environment after running a test. */ protected function tearDown() { $this->service = null; parent::tearDown(); } /** * Constructs the test case. */ public function __construct() {} /** * Tests JsonDbOpensocialService->getActivities() with paging. */ public function testGetActivities() { $token = BasicSecurityToken::createFromValues('jane.doe', 'jane.doe', 1, 1, 1, 1); $userId = new UserId('owner', null); $userIds = array($userId); $groupId = new GroupId('self', null); $startIndex = 1; $count = 1; $ret = $this->service->getActivities($userIds, $groupId, 1, null, null, null, null, $startIndex, $count, null, 1, $token); $this->assertEquals($startIndex, $ret->startIndex); $this->assertEquals($count, count($ret->entry)); $this->assertEquals(2, $ret->totalResults); $this->assertEquals('2', $ret->entry[0]['id']); $this->assertEquals('Jane says George likes yoda!', $ret->entry[0]['title']); $this->assertEquals('or is it you?', $ret->entry[0]['body']); } }