diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-21 13:43:39 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-21 13:43:39 +0200 |
commit | eaf152efebc1a75e5a61e8d8c362d9fe29841c5c (patch) | |
tree | cb7db36eb9fd157c5d808183e2f48d62e259330b /tests/lib/Comments | |
parent | 13168ffbbaaa52fed52b2c0b83298ede2fd369c7 (diff) | |
download | nextcloud-server-eaf152efebc1a75e5a61e8d8c362d9fe29841c5c.tar.gz nextcloud-server-eaf152efebc1a75e5a61e8d8c362d9fe29841c5c.zip |
Fix DateTime comparisson
Datetime now returns microseconds. But if the database doesn't store
those comparing them for equality most likely fails.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Comments')
-rw-r--r-- | tests/lib/Comments/ManagerTest.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php index 71c918af6c7..5bacc794ba7 100644 --- a/tests/lib/Comments/ManagerTest.php +++ b/tests/lib/Comments/ManagerTest.php @@ -111,7 +111,7 @@ class ManagerTest extends TestCase { $this->assertSame($comment->getVerb(), 'comment'); $this->assertSame($comment->getObjectType(), 'files'); $this->assertSame($comment->getObjectId(), 'file64'); - $this->assertEquals($comment->getCreationDateTime(), $creationDT); + $this->assertEquals($comment->getCreationDateTime()->getTimestamp(), $creationDT->getTimestamp()); $this->assertEquals($comment->getLatestChildDateTime(), $latestChildDT); } @@ -373,7 +373,7 @@ class ManagerTest extends TestCase { $loadedComment = $manager->get($comment->getId()); $this->assertSame($comment->getMessage(), $loadedComment->getMessage()); - $this->assertEquals($comment->getCreationDateTime(), $loadedComment->getCreationDateTime()); + $this->assertEquals($comment->getCreationDateTime()->getTimestamp(), $loadedComment->getCreationDateTime()->getTimestamp()); } public function testSaveUpdate() { @@ -444,7 +444,7 @@ class ManagerTest extends TestCase { $this->assertSame($comment->getTopmostParentId(), strval($id)); $parentComment = $manager->get(strval($id)); $this->assertSame($parentComment->getChildrenCount(), $i + 1); - $this->assertEquals($parentComment->getLatestChildDateTime(), $comment->getCreationDateTime()); + $this->assertEquals($parentComment->getLatestChildDateTime()->getTimestamp(), $comment->getCreationDateTime()->getTimestamp()); } } @@ -577,7 +577,7 @@ class ManagerTest extends TestCase { $dateTimeGet = $manager->getReadMark('robot', '36', $user); - $this->assertEquals($dateTimeGet, $dateTimeSet); + $this->assertEquals($dateTimeGet->getTimestamp(), $dateTimeSet->getTimestamp()); } public function testSetMarkReadUpdate() { |