/** * Test the modifying of a page */ public function testModifyPage() { $modified_xml = file_get_contents(dirname(__FILE__) . '/data/page_modified.xml'); $this->oauthClient->expects($this->once())->method('authenticatedPost')->with('page/f412b8a3-8b12-44bc-9a0a-c74ec0e88e98', array('name' => 'test'))->will($this->returnValue($modified_xml)); $uid = $this->pages->updatePage('f412b8a3-8b12-44bc-9a0a-c74ec0e88e98', array('name' => 'test')); // $this->assertEquals($uid, 'f412b8a3-8b12-44bc-9a0a-c74ec0e88e98'); }
/** * Test the requesting of a message */ public function testGetMessage() { $message_xml = file_get_contents(dirname(__FILE__) . '/data/message.xml'); $this->oauthClient->expects($this->once())->method('authenticatedGetAsXml')->with('message/1')->will($this->returnValue($message_xml)); $message = $this->messages->getMessage(1); $this->assertInstanceOf('CultureFeed_Messages_Message', $message); $this->assertEquals($this->message->id, $message->id); }
public function testAddCollaborationLinkToEvent() { $copyright = 'copyright'; $description = 'description'; $lang = 'nl'; $plain_text = 'plaint text'; $sub_brand = 'consumer key'; $title = 'title'; $this->oauthClient->expects($this->once())->method('authenticatedPostAsXml')->with('event/xyz/links', array('lang' => $lang, 'linktype' => CultureFeed_Cdb_Data_File::MEDIA_TYPE_COLLABORATION, 'title' => $title, 'copyright' => $copyright, 'plaintext' => $plain_text, 'subbrand' => $sub_brand, 'description' => $description))->willReturn($this->linkCreatedResponse()); $this->entry->addCollaborationLinkToEvent($this->event, $lang, $plain_text, $title, $copyright, $sub_brand, $description); }
public function testGetListWithIncorrectXml() { $saved_search_list_xml = file_get_contents(dirname(__FILE__) . '/data/savedsearchlist_missing_parameter.xml'); $this->oauthClient->expects($this->once())->method('authenticatedGetAsXml')->with($this->equalTo('savedSearch/list'), $this->equalTo(array('all' => 'true')))->will($this->returnValue($saved_search_list_xml)); $this->setExpectedException('CultureFeed_ParseException'); $result = $this->savedSearches->getList(TRUE); }
/** * Test searching users. */ public function testSearchUsers() { $query = new CultureFeed_SearchUsersQuery(); $query->name = 'john'; $query->mboxIncludePrivate = true; $search_users_xml = file_get_contents(dirname(__FILE__) . '/data/search_users.xml'); $this->oauthClient->expects($this->once())->method('consumerGetAsXml')->with('user/search', array('name' => 'john', 'mboxIncludePrivate' => 'true'))->will($this->returnValue($search_users_xml)); $johnDoe = new CultureFeed_SearchUser(); $johnDoe->id = 'A5912755-8060-4CB7-B0D1-51717725A46A'; $johnDoe->nick = 'john.doe'; $johnDoe->mbox = '*****@*****.**'; $johnDoe->depiction = '//media.uitid.be/fis/rest/download/ce126667652776f0e9e55160f12f5463/uiv/default.png'; $johnDoe->sortValue = null; $johnySmith = new CultureFeed_SearchUser(); $johnySmith->id = '0AC1C30A-4821-4D82-98AD-ADC02FBC0059'; $johnySmith->nick = 'johny.smith'; $johnySmith->mbox = '*****@*****.**'; $johnySmith->depiction = '//media.uitid.be/fis/rest/download/ce126667652776f0e9e55160f12f5325/uiv/picture-5015.jpg'; $johnySmith->sortValue = null; $expectedUsers = array($johnDoe, $johnySmith); $expectedResults = new CultureFeed_ResultSet(2, $expectedUsers); $actualResults = $this->cultureFeed->searchUsers($query); $this->assertEquals($expectedResults, $actualResults); }