Skip to content

Commit 8357469

Browse files
Merge pull request nextcloud#52070 from nextcloud/test/noid/improve-test-output
test: Improve comments manager test output in case of failure
2 parents b82245d + e2cd436 commit 8357469

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/lib/Comments/ManagerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,14 +507,14 @@ public function testSave(string $message, string $actorId, string $verb, ?string
507507
}
508508

509509
$saveSuccessful = $manager->save($comment);
510-
$this->assertTrue($saveSuccessful);
511-
$this->assertTrue($comment->getId() !== '');
512-
$this->assertTrue($comment->getId() !== '0');
513-
$this->assertTrue(!is_null($comment->getCreationDateTime()));
510+
$this->assertTrue($saveSuccessful, 'Comment saving was not successful');
511+
$this->assertNotEquals('', $comment->getId(), 'Comment ID should not be empty');
512+
$this->assertNotEquals('0', $comment->getId(), 'Comment ID should not be string \'0\'');
513+
$this->assertNotNull($comment->getCreationDateTime(), 'Comment creation date should not be null');
514514

515515
$loadedComment = $manager->get($comment->getId());
516-
$this->assertSame($comment->getMessage(), $loadedComment->getMessage());
517-
$this->assertEquals($comment->getCreationDateTime()->getTimestamp(), $loadedComment->getCreationDateTime()->getTimestamp());
516+
$this->assertSame($comment->getMessage(), $loadedComment->getMessage(), 'Comment message should match');
517+
$this->assertEquals($comment->getCreationDateTime()->getTimestamp(), $loadedComment->getCreationDateTime()->getTimestamp(), 'Comment creation date should match');
518518
return $comment;
519519
}
520520

0 commit comments

Comments
 (0)