@@ 689-700 (lines=12) @@ | ||
686 | $this->assertSame($item->ID, $parent->ID); |
|
687 | } |
|
688 | ||
689 | public function testGetParentTitle() |
|
690 | { |
|
691 | $comment = $this->objFromFixture(Comment::class, 'firstComA'); |
|
692 | $title = $comment->getParentTitle(); |
|
693 | $this->assertEquals('First', $title); |
|
694 | ||
695 | // Title from a comment with no parent is blank |
|
696 | $comment->ParentID = 0; |
|
697 | $comment->ParentClass = null; |
|
698 | $comment->write(); |
|
699 | $this->assertEquals('', $comment->getParentTitle()); |
|
700 | } |
|
701 | ||
702 | public function testGetParentClassName() |
|
703 | { |
|
@@ 902-910 (lines=9) @@ | ||
899 | $this->assertTrue($comment->Moderated); |
|
900 | } |
|
901 | ||
902 | public function testSpamClass() |
|
903 | { |
|
904 | $comment = $this->objFromFixture(Comment::class, 'firstComA'); |
|
905 | $this->assertEquals('notspam', $comment->spamClass()); |
|
906 | $comment->Moderated = false; |
|
907 | $this->assertEquals('unmoderated', $comment->spamClass()); |
|
908 | $comment->IsSpam = true; |
|
909 | $this->assertEquals('spam', $comment->spamClass()); |
|
910 | } |
|
911 | ||
912 | public function testGetTitle() |
|
913 | { |