|
@@ 695-706 (lines=12) @@
|
| 692 |
|
$this->assertSame($item->ID, $parent->ID); |
| 693 |
|
} |
| 694 |
|
|
| 695 |
|
public function testGetParentTitle() |
| 696 |
|
{ |
| 697 |
|
$comment = $this->objFromFixture(Comment::class, 'firstComA'); |
| 698 |
|
$title = $comment->getParentTitle(); |
| 699 |
|
$this->assertEquals('First', $title); |
| 700 |
|
|
| 701 |
|
// Title from a comment with no parent is blank |
| 702 |
|
$comment->ParentID = 0; |
| 703 |
|
$comment->ParentClass = null; |
| 704 |
|
$comment->write(); |
| 705 |
|
$this->assertEquals('', $comment->getParentTitle()); |
| 706 |
|
} |
| 707 |
|
|
| 708 |
|
public function testGetParentClassName() |
| 709 |
|
{ |
|
@@ 908-916 (lines=9) @@
|
| 905 |
|
$this->assertTrue($comment->Moderated); |
| 906 |
|
} |
| 907 |
|
|
| 908 |
|
public function testSpamClass() |
| 909 |
|
{ |
| 910 |
|
$comment = $this->objFromFixture(Comment::class, 'firstComA'); |
| 911 |
|
$this->assertEquals('notspam', $comment->spamClass()); |
| 912 |
|
$comment->Moderated = false; |
| 913 |
|
$this->assertEquals('unmoderated', $comment->spamClass()); |
| 914 |
|
$comment->IsSpam = true; |
| 915 |
|
$this->assertEquals('spam', $comment->spamClass()); |
| 916 |
|
} |
| 917 |
|
|
| 918 |
|
public function testGetTitle() |
| 919 |
|
{ |