add actor info to tests

This commit is contained in:
Evan Prodromou 2010-08-03 15:49:49 -07:00
parent 8d19162122
commit 744233c6dc

View File

@ -165,7 +165,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
$this->assertEquals($atomUrl, ActivityUtils::childContent($source, 'id'));
$this->assertEquals($atomUrl, ActivityUtils::getLink($source, 'self', 'application/atom+xml'));
$this->assertEquals($profile->profileurl, ActivityUtils::getPermalink($source));
$this->assertEquals($notice2->created, strtotime(ActivityUtils::childContent($source, 'updated')));
$this->assertEquals(strtotime($notice2->created), strtotime(ActivityUtils::childContent($source, 'updated')));
// XXX: do we care here?
$this->assertFalse(is_null(ActivityUtils::childContent($source, 'title')));
$this->assertEquals(common_config('license', 'url'), ActivityUtils::getLink($source, 'license'));
@ -208,12 +208,27 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
$element = $this->_entryToElement($entry, true);
$author = ActivityUtils::child($element, 'author');
$actor = ActivityUtils::child($element, 'actor', Activity::SPEC);
$this->assertEquals($this->author1->nickname, ActivityUtils::childContent($author, 'name'));
$this->assertEquals($this->author1->uri, ActivityUtils::childContent($author, 'uri'));
}
public function testActorContent()
{
$notice = $this->_fakeNotice();
// Test with author
$entry = $notice->asAtomEntry(false, false, true);
$element = $this->_entryToElement($entry, true);
$actor = ActivityUtils::child($element, 'actor', Activity::SPEC);
$this->assertEquals($this->author1->uri, ActivityUtils::childContent($actor, 'id'));
$this->assertEquals($this->author1->nickname, ActivityUtils::childContent($actor, 'title'));
}
public function testReplyLink()
{
$orig = $this->_fakeNotice($this->targetUser1);