assertFalse(empty($dom)); $entries = $dom->getElementsByTagName('entry'); $entry1 = $entries->item(0); $this->assertFalse(empty($entry1)); $feedEl = $dom->getElementsByTagName('feed')->item(0); $this->assertFalse(empty($feedEl)); // Test actor (from activity:subject) $act1 = new Activity($entry1, $feedEl); $this->assertFalse(empty($act1)); $this->assertFalse(empty($act1->actor)); $this->assertEquals($act1->actor->type, ActivityObject::PERSON); $this->assertEquals($act1->actor->title, 'Zach Copley'); $this->assertEquals($act1->actor->id, 'http://localhost/statusnet/user/1'); $this->assertEquals($act1->actor->link, 'http://localhost/statusnet/zach'); $avatars = $act1->actor->avatarLinks; $this->assertEquals( $avatars[0]->url, 'http://localhost/statusnet/theme/default/default-avatar-profile.png' ); $this->assertEquals( $avatars[1]->url, 'http://localhost/statusnet/theme/default/default-avatar-stream.png' ); $this->assertEquals( $avatars[2]->url, 'http://localhost/statusnet/theme/default/default-avatar-mini.png' ); $this->assertEquals($act1->actor->displayName, 'Zach Copley'); $poco = $act1->actor->poco; $this->assertEquals($poco->preferredUsername, 'zach'); $this->assertEquals($poco->address->formatted, 'El Cerrito, CA'); $this->assertEquals($poco->urls[0]->type, 'homepage'); $this->assertEquals($poco->urls[0]->value, 'http://zach.copley.name'); $this->assertEquals($poco->urls[0]->primary, 'true'); $this->assertEquals($poco->note, 'Zach Hack Attack'); // test the post //var_export($act1); $this->assertEquals($act1->object->type, 'http://activitystrea.ms/schema/1.0/note'); $this->assertEquals($act1->object->title, 'And now for something completely insane...'); $this->assertEquals($act1->object->content, 'And now for something completely insane...'); $this->assertEquals($act1->object->id, 'http://localhost/statusnet/notice/3'); } } $_testfeed1 = << http://localhost/statusnet/api/statuses/user_timeline/1.atom zach timeline Updates from zach on Zach Dev! http://localhost/statusnet/theme/default/default-avatar-profile.png 2010-03-04T01:41:14+00:00 zach http://localhost/statusnet/user/1 http://activitystrea.ms/schema/1.0/person http://localhost/statusnet/user/1 Zach Copley zach Zach Copley Zach Hack Attack El Cerrito, CA homepage http://zach.copley.name true And now for something completely insane... http://localhost/statusnet/notice/3 2010-03-04T01:41:07+00:00 2010-03-04T01:41:07+00:00 And now for something completely insane... TESTFEED1;