]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - tests/ActivityGenerationTests.php
Misses this file to merge. I like the comments.
[quix0rs-gnu-social.git] / tests / ActivityGenerationTests.php
index 4c4db6148aa59e9db9e429bc226b1d7458fb6d0d..f5ea3ad442374f308ab6acff43ffd22cd9bfeb65 100644 (file)
@@ -81,7 +81,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
 
         $element = $this->_entryToElement($entry, false);
 
-        $this->assertEquals($notice->uri, ActivityUtils::childContent($element, 'id'));
+        $this->assertEquals($notice->getUri(), ActivityUtils::childContent($element, 'id'));
         $this->assertEquals($notice->content, ActivityUtils::childContent($element, 'title'));
         $this->assertEquals($notice->rendered, ActivityUtils::childContent($element, 'content'));
         $this->assertEquals(strtotime($notice->created), strtotime(ActivityUtils::childContent($element, 'published')));
@@ -210,8 +210,8 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
 
         $author = ActivityUtils::child($element, 'author');
 
-        $this->assertEquals($this->author1->nickname, ActivityUtils::childContent($author, 'name'));
-        $this->assertEquals($this->author1->uri, ActivityUtils::childContent($author, 'uri'));
+        $this->assertEquals($this->author1->getNickname(), ActivityUtils::childContent($author, 'name'));
+        $this->assertEquals($this->author1->getUri(), ActivityUtils::childContent($author, 'uri'));
     }
 
     /**
@@ -247,8 +247,8 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
         $irt = ActivityUtils::child($element, 'in-reply-to', 'http://purl.org/syndication/thread/1.0');
 
         $this->assertNotNull($irt);
-        $this->assertEquals($orig->uri, $irt->getAttribute('ref'));
-        $this->assertEquals($orig->bestUrl(), $irt->getAttribute('href'));
+        $this->assertEquals($orig->getUri(), $irt->getAttribute('ref'));
+        $this->assertEquals($orig->getUrl(), $irt->getAttribute('href'));
     }
 
     public function testReplyAttention()
@@ -263,7 +263,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
 
         $element = $this->_entryToElement($entry, true);
 
-        $this->assertEquals($this->targetUser1->uri, ActivityUtils::getLink($element, 'mentioned'));
+        $this->assertEquals($this->targetUser1->getUri(), ActivityUtils::getLink($element, 'mentioned'));
     }
 
     public function testMultipleReplyAttention()
@@ -292,8 +292,8 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
             $hrefs[] = $link->getAttribute('href');
         }
 
-        $this->assertTrue(in_array($this->targetUser1->uri, $hrefs));
-        $this->assertTrue(in_array($this->targetUser2->uri, $hrefs));
+        $this->assertTrue(in_array($this->targetUser1->getUri(), $hrefs));
+        $this->assertTrue(in_array($this->targetUser2->getUri(), $hrefs));
 
         $links = ActivityUtils::getLinks($element, 'mentioned');
 
@@ -305,8 +305,8 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
             $hrefs[] = $link->getAttribute('href');
         }
 
-        $this->assertTrue(in_array($this->targetUser1->uri, $hrefs));
-        $this->assertTrue(in_array($this->targetUser2->uri, $hrefs));
+        $this->assertTrue(in_array($this->targetUser1->getUri(), $hrefs));
+        $this->assertTrue(in_array($this->targetUser2->getUri(), $hrefs));
     }
 
     public function testGroupPostAttention()
@@ -319,7 +319,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
 
         $element = $this->_entryToElement($entry, true);
 
-        $this->assertEquals($this->targetGroup1->uri, ActivityUtils::getLink($element, 'mentioned'));
+        $this->assertEquals($this->targetGroup1->getUri(), ActivityUtils::getLink($element, 'mentioned'));
     }
 
     public function testMultipleGroupPostAttention()
@@ -342,8 +342,8 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
             $hrefs[] = $link->getAttribute('href');
         }
 
-        $this->assertTrue(in_array($this->targetGroup1->uri, $hrefs));
-        $this->assertTrue(in_array($this->targetGroup2->uri, $hrefs));
+        $this->assertTrue(in_array($this->targetGroup1->getUri(), $hrefs));
+        $this->assertTrue(in_array($this->targetGroup2->getUri(), $hrefs));
 
         $links = ActivityUtils::getLinks($element, 'mentioned');
 
@@ -355,14 +355,14 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
             $hrefs[] = $link->getAttribute('href');
         }
 
-        $this->assertTrue(in_array($this->targetGroup1->uri, $hrefs));
-        $this->assertTrue(in_array($this->targetGroup2->uri, $hrefs));
+        $this->assertTrue(in_array($this->targetGroup1->getUri(), $hrefs));
+        $this->assertTrue(in_array($this->targetGroup2->getUri(), $hrefs));
     }
 
     public function testRepeatLink()
     {
         $notice = $this->_fakeNotice($this->author1);
-        $repeat = $notice->repeat($this->author2->id, 'test');
+        $repeat = $notice->repeat($this->author2->getProfile(), 'test');
 
         $entry = $repeat->asAtomEntry();
 
@@ -371,8 +371,8 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
         $forward = ActivityUtils::child($element, 'forward', "http://ostatus.org/schema/1.0");
 
         $this->assertNotNull($forward);
-        $this->assertEquals($notice->uri, $forward->getAttribute('ref'));
-        $this->assertEquals($notice->bestUrl(), $forward->getAttribute('href'));
+        $this->assertEquals($notice->getUri(), $forward->getAttribute('ref'));
+        $this->assertEquals($notice->getUrl(), $forward->getAttribute('href'));
     }
 
     public function testTag()
@@ -443,7 +443,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
         $this->assertEquals($notice->source, $noticeInfo->getAttribute('source'));
         $this->assertEquals('', $noticeInfo->getAttribute('repeat_of'));
         $this->assertEquals('', $noticeInfo->getAttribute('repeated'));
-        $this->assertEquals('', $noticeInfo->getAttribute('favorite'));
+//        $this->assertEquals('', $noticeInfo->getAttribute('favorite'));
         $this->assertEquals('', $noticeInfo->getAttribute('source_link'));
     }
 
@@ -451,7 +451,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
     {
         $notice = $this->_fakeNotice();
 
-        $repeat = $notice->repeat($this->author2->id, 'test');
+        $repeat = $notice->repeat($this->author2->getProfile(), 'test');
 
         $entry = $repeat->asAtomEntry();
 
@@ -466,7 +466,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
     {
         $notice = $this->_fakeNotice();
 
-        $repeat = $notice->repeat($this->author2->id, 'test');
+        $repeat = $notice->repeat($this->author2->getProfile(), 'test');
 
         $entry = $notice->asAtomEntry(false, false, false, $this->author2);
 
@@ -485,7 +485,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
         $this->assertEquals('false', $noticeInfo->getAttribute('repeated'));
     }
 
-    public function testNoticeInfoFave()
+/*    public function testNoticeInfoFave()
     {
         $notice = $this->_fakeNotice();
 
@@ -510,7 +510,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
         $noticeInfo = ActivityUtils::child($element, 'notice_info', "http://status.net/schema/api/1/");
 
         $this->assertEquals('false', $noticeInfo->getAttribute('favorite'));
-    }
+    }*/
 
     public function testConversationLink()
     {
@@ -526,7 +526,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
 
         $element = $this->_entryToElement($entry, true);
 
-        $this->assertEquals($conv->uri, ActivityUtils::getLink($element, 'ostatus:conversation'));
+        $this->assertEquals($conv->getUri(), ActivityUtils::getLink($element, 'ostatus:conversation'));
     }
 
     function __destruct()