From e497ddc81f5a480e2362494f264d0ac1fe78a9f4 Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Sat, 20 Mar 2010 16:53:47 -0500
Subject: test posterous author use
---
tests/ActivityParseTests.php | 85 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
(limited to 'tests')
diff --git a/tests/ActivityParseTests.php b/tests/ActivityParseTests.php
index b6980a6bb..9d8fd47af 100644
--- a/tests/ActivityParseTests.php
+++ b/tests/ActivityParseTests.php
@@ -170,6 +170,51 @@ class ActivityParseTests extends PHPUnit_Framework_TestCase
$this->assertFalse(empty($actor));
$this->assertEquals($actor->title, "Joseph Scott");
}
+
+ public function testExample7()
+ {
+ global $_example7;
+
+ $dom = DOMDocument::loadXML($_example7);
+
+ $rss = $dom->documentElement;
+
+ $channels = $dom->getElementsByTagName('channel');
+
+ $channel = $channels->item(0);
+
+ $items = $channel->getElementsByTagName('item');
+
+ $item = $items->item(0);
+
+ $act = new Activity($item, $channel);
+
+ $this->assertEquals(ActivityVerb::POST, $act->verb);
+ $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->link);
+ $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->id);
+ $this->assertEquals('Checking out captain bones', $act->title);
+ $this->assertEquals(1269095551, $act->time);
+
+ $actor = $act->actor;
+
+ $this->assertEquals(ActivityObject::PERSON, $actor->type);
+ $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->id);
+ $this->assertEquals('Evan Prodromou', $actor->title);
+ $this->assertNull($actor->summary);
+ $this->assertNull($actor->content);
+ $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->link);
+ $this->assertNull($actor->source);
+ $this->assertTrue(is_array($actor->avatarLinks));
+ $this->assertEquals(1, count($actor->avatarLinks));
+ $this->assertEquals('http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg',
+ $actor->avatarLinks[0]);
+ $this->assertNotNull($actor->poco);
+ $this->assertEquals('evanpro', $actor->poco->preferredUsername);
+ $this->assertEquals('Evan Prodromou', $actor->poco->displayName);
+ $this->assertNull($actor->poco->note);
+ $this->assertNull($actor->poco->address);
+ $this->assertEquals(0, count($actor->poco->urls));
+ }
}
$_example1 = <<
EXAMPLE6;
+$_example7 = <<
+
+
+ evanpro's posterous
+ http://evanpro.posterous.com
+ Most recent posts at evanpro's posterous
+ posterous.com
+
+
+
+ -
+ Sat, 20 Mar 2010 07:32:31 -0700
+ Checking out captain bones
+ http://evanpro.posterous.com/checking-out-captain-bones
+ http://evanpro.posterous.com/checking-out-captain-bones
+
+
+
Bones!
+
+
+
+ Permalink
+
+ | Leave a comment »
+
+
]]>
+
+
+ http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg
+ http://posterous.com/people/3sDslhaepotz
+ Evan
+ Prodromou
+ evanpro
+ Evan Prodromou
+
+
+
+
+EXAMPLE7;
--
cgit v1.2.3-54-g00ecf