summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-03 15:49:49 -0700
committerEvan Prodromou <evan@status.net>2010-08-03 15:49:49 -0700
commit744233c6dc385a5870652ab70e7141e75aaff783 (patch)
tree532bba4bb6875d7b0c940d9012fa9ff3d4a76190
parent8d19162122bef8c0661473fc444cceeab7b5ac5a (diff)
add actor info to tests
-rw-r--r--tests/ActivityGenerationTests.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/ActivityGenerationTests.php b/tests/ActivityGenerationTests.php
index cc82151b9..52077ee57 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);