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>
This commit is contained in:
Roeland Jago Douma 2016-10-21 13:43:39 +02:00
parent 13168ffbba
commit eaf152efeb
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
2 changed files with 5 additions and 5 deletions

View File

@ -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() {

View File

@ -743,7 +743,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame($path, $share2->getNode());
$this->assertSame('password', $share2->getPassword());
$this->assertSame('token', $share2->getToken());
$this->assertEquals($expireDate, $share2->getExpirationDate());
$this->assertEquals($expireDate->getTimestamp(), $share2->getExpirationDate()->getTimestamp());
}
public function testGetShareByToken() {