From: Roger Braun Date: Sun, 4 Dec 2016 15:19:59 +0000 (+0100) Subject: Test for correct post object in retweets. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8c6c6039a28906bdcbefa86029d6be0b1dc697ae;p=quix0rs-gnu-social.git Test for correct post object in retweets. --- diff --git a/tests/ActivityParseTests.php b/tests/ActivityParseTests.php index 90d214c54d..566318e9ea 100644 --- a/tests/ActivityParseTests.php +++ b/tests/ActivityParseTests.php @@ -15,6 +15,35 @@ require_once INSTALLDIR . '/lib/common.php'; class ActivityParseTests extends PHPUnit_Framework_TestCase { + + public function testMastodonRetweet() { + global $_mastodon_retweet; + $dom = DOMDocument::loadXML($_mastodon_retweet); + $feed = $dom->documentElement; + $entries = $feed->getElementsByTagName('entry'); + $entry = $entries->item(0); + $act = new Activity($entry, $feed); + $this->assertFalse(empty($act)); + $this->assertFalse(empty($act->objects[0])); + + $object = $act->objects[0]; + $this->assertEquals($object->verb, ActivityVerb::POST); + } + + public function testGSReweet() { + global $_gs_retweet; + $dom = DOMDocument::loadXML($_gs_retweet); + $feed = $dom->documentElement; + $entries = $feed->getElementsByTagName('entry'); + $entry = $entries->item(0); + $act = new Activity($entry, $feed); + $this->assertFalse(empty($act)); + $this->assertFalse(empty($act->objects[0])); + + $object = $act->objects[0]; + $this->assertEquals($object->verb, ActivityVerb::POST); + } + public function testExample1() { global $_example1;