From 62f5c04ad234be6d1a26097300944eacee895738 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 14 Feb 2010 12:08:09 -0500 Subject: [PATCH] More complete activity parsing Began the process of actually digging up activity information from an Atom entry. Added a test script to make sure parsing is working right. --- plugins/OStatus/tests/ActivityParseTests.php | 80 ++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 plugins/OStatus/tests/ActivityParseTests.php diff --git a/plugins/OStatus/tests/ActivityParseTests.php b/plugins/OStatus/tests/ActivityParseTests.php new file mode 100644 index 0000000000..889fa892f0 --- /dev/null +++ b/plugins/OStatus/tests/ActivityParseTests.php @@ -0,0 +1,80 @@ +documentElement); + + $this->assertFalse(empty($act)); + $this->assertEquals($act->time, 1243860840); + $this->assertEquals($act->verb, ActivityVerb::POST); + } +} + +$_example1 = << + + tag:versioncentral.example.org,2009:/commit/1643245 + 2009-06-01T12:54:00Z + Geraldine committed a change to yate + Geraldine just committed a change to yate on VersionCentral + + http://activitystrea.ms/schema/1.0/post + http://versioncentral.example.org/activity/commit + + http://versioncentral.example.org/activity/changeset + tag:versioncentral.example.org,2009:/change/1643245 + Punctuation Changeset + Fixing punctuation because it makes it more readable. + + + +EXAMPLE1; + +$_example2 = << + + tag:photopanic.example.com,2008:activity01 + Geraldine posted a Photo on PhotoPanic + 2008-11-02T15:29:00Z + + + http://activitystrea.ms/schema/1.0/post + + + tag:photopanic.example.com,2008:photo01 + My Cat + 2008-11-02T15:29:00Z + + + tag:atomactivity.example.com,2008:photo + + + Geraldine's Photos + + + + + + <p>Geraldine posted a Photo on PhotoPanic</p> + <img src="/geraldine/photo1.jpg"> + + +EXAMPLE2;