From: Evan Prodromou Date: Tue, 3 Aug 2010 22:49:49 +0000 (-0700) Subject: add actor info to tests X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=744233c6dc385a5870652ab70e7141e75aaff783;p=quix0rs-gnu-social.git add actor info to tests --- diff --git a/tests/ActivityGenerationTests.php b/tests/ActivityGenerationTests.php index cc82151b99..52077ee570 100644 --- a/tests/ActivityGenerationTests.php +++ b/tests/ActivityGenerationTests.php @@ -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);