Skip to content

Commit 04aa8dd

Browse files
committed
Convert to using MongoDB\BSON\UTCDateTime instead of php-adapter MongoTimestamp
1 parent 451f165 commit 04aa8dd

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/AntiMattr/MongoDB/Migrations/Version.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Doctrine\MongoDB\Collection;
1919
use Doctrine\MongoDB\Database;
2020
use Exception;
21-
use MongoTimestamp;
21+
use MongoDB\BSON\UTCDateTime;
2222

2323
/**
2424
* @author Matthew Fitzgerald <matthewfitz@gmail.com>
@@ -382,11 +382,11 @@ protected function createMigration()
382382
}
383383

384384
/**
385-
* @return MongoTimestamp
385+
* @return UTCDateTime
386386
*/
387387
protected function createMongoTimestamp()
388388
{
389-
return new MongoTimestamp();
389+
return new UTCDateTime();
390390
}
391391

392392
/**

tests/AntiMattr/Tests/MongoDB/Migrations/VersionTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use AntiMattr\MongoDB\Migrations\Version;
77
use AntiMattr\TestCase\AntiMattrTestCase;
88
use Doctrine\MongoDB\Database;
9+
use MongoDB\BSON\UTCDateTime;
910

1011
class VersionTest extends AntiMattrTestCase
1112
{
@@ -99,7 +100,7 @@ public function testAnalyze()
99100

100101
public function testMarkMigrated()
101102
{
102-
$timestamp = $this->buildMock('MongoTimestamp');
103+
$timestamp = new UTCDateTime();
103104
$this->version->setTimestamp($timestamp);
104105

105106
$collection = $this->buildMock('Doctrine\MongoDB\Collection');
@@ -124,7 +125,7 @@ public function testMarkMigrated()
124125

125126
public function testMarkMigratedWithReplay()
126127
{
127-
$timestamp = $this->buildMock('MongoTimestamp');
128+
$timestamp = new UTCDateTime();
128129
$this->version->setTimestamp($timestamp);
129130

130131
$collection = $this->buildMock('Doctrine\MongoDB\Collection');
@@ -154,7 +155,7 @@ public function testMarkMigratedWithReplay()
154155

155156
public function testMarkNotMigrated()
156157
{
157-
$timestamp = $this->buildMock('MongoTimestamp');
158+
$timestamp = new UTCDateTime();
158159
$this->version->setTimestamp($timestamp);
159160

160161
$collection = $this->buildMock('Doctrine\MongoDB\Collection');

0 commit comments

Comments
 (0)