summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-21 09:17:52 -0500
committerEvan Prodromou <evan@status.net>2010-02-21 09:17:52 -0500
commit7f471bde231071e3512f203ceca4b830ac2204a1 (patch)
tree574235a6037e07572ec9be8fc312ccd772aae454 /plugins
parent4a4c34de3221eb8000e911addad039cd170faaa1 (diff)
more tests for Activity parsing
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OStatus/tests/ActivityParseTests.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/OStatus/tests/ActivityParseTests.php b/plugins/OStatus/tests/ActivityParseTests.php
index 35b4b0f9d..d7305dede 100644
--- a/plugins/OStatus/tests/ActivityParseTests.php
+++ b/plugins/OStatus/tests/ActivityParseTests.php
@@ -22,8 +22,15 @@ class ActivityParseTests extends PHPUnit_Framework_TestCase
$act = new Activity($dom->documentElement);
$this->assertFalse(empty($act));
+
$this->assertEquals($act->time, 1243860840);
$this->assertEquals($act->verb, ActivityVerb::POST);
+
+ $this->assertFalse(empty($act->object));
+ $this->assertEquals($act->object->title, 'Punctuation Changeset');
+ $this->assertEquals($act->object->type, 'http://versioncentral.example.org/activity/changeset');
+ $this->assertEquals($act->object->summary, 'Fixing punctuation because it makes it more readable.');
+ $this->assertEquals($act->object->id, 'tag:versioncentral.example.org,2009:/change/1643245');
}
public function testExample3()
@@ -84,6 +91,10 @@ class ActivityParseTests extends PHPUnit_Framework_TestCase
$this->assertEquals('http://example.net/conversation/11', $act->context->conversation);
$this->assertEquals(array('http://example.net/user/1'), $act->context->attention);
+ $this->assertFalse(empty($act->object));
+ $this->assertEquals($act->object->content,
+ '@<span class="vcard"><a href="http://example.net/user/1" class="url"><span class="fn nickname">evan</span></a></span> now is the time for all good men to come to the aid of their country. #<span class="tag"><a href="http://example.net/tag/thetime" rel="tag">thetime</a></span>');
+
$this->assertFalse(empty($act->actor));
}
}