diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2025-04-09 16:08:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-09 16:08:19 +0200 |
commit | 8357469557f953bea82e2f7cbfca47058ce5e5a8 (patch) | |
tree | b4788a0951a47afab4d6b815acbcf6054589a946 | |
parent | b82245ddea2db5bf1f2211199811454a5dbc0ee1 (diff) | |
parent | e2cd4362050ece7772d8cd8a150b8865d9b1ba58 (diff) | |
download | nextcloud-server-8357469557f953bea82e2f7cbfca47058ce5e5a8.tar.gz nextcloud-server-8357469557f953bea82e2f7cbfca47058ce5e5a8.zip |
Merge pull request #52070 from nextcloud/test/noid/improve-test-output
test: Improve comments manager test output in case of failure
-rw-r--r-- | tests/lib/Comments/ManagerTest.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php index 15961b029f5..02118125c24 100644 --- a/tests/lib/Comments/ManagerTest.php +++ b/tests/lib/Comments/ManagerTest.php @@ -507,14 +507,14 @@ class ManagerTest extends TestCase { } $saveSuccessful = $manager->save($comment); - $this->assertTrue($saveSuccessful); - $this->assertTrue($comment->getId() !== ''); - $this->assertTrue($comment->getId() !== '0'); - $this->assertTrue(!is_null($comment->getCreationDateTime())); + $this->assertTrue($saveSuccessful, 'Comment saving was not successful'); + $this->assertNotEquals('', $comment->getId(), 'Comment ID should not be empty'); + $this->assertNotEquals('0', $comment->getId(), 'Comment ID should not be string \'0\''); + $this->assertNotNull($comment->getCreationDateTime(), 'Comment creation date should not be null'); $loadedComment = $manager->get($comment->getId()); - $this->assertSame($comment->getMessage(), $loadedComment->getMessage()); - $this->assertEquals($comment->getCreationDateTime()->getTimestamp(), $loadedComment->getCreationDateTime()->getTimestamp()); + $this->assertSame($comment->getMessage(), $loadedComment->getMessage(), 'Comment message should match'); + $this->assertEquals($comment->getCreationDateTime()->getTimestamp(), $loadedComment->getCreationDateTime()->getTimestamp(), 'Comment creation date should match'); return $comment; } |