|
@@ -38,7 +38,12 @@ class MongoDateTest extends TestCase
|
|
|
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $bsonDate);
|
|
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $bsonDate);
|
|
|
$this->assertSame('1234567890123', (string) $bsonDate);
|
|
$this->assertSame('1234567890123', (string) $bsonDate);
|
|
|
|
|
|
|
|
- $this->assertEquals($dateTime, $bsonDate->toDateTime());
|
|
|
|
|
|
|
+ $bsonDateTime = $bsonDate->toDateTime();
|
|
|
|
|
+
|
|
|
|
|
+ // Compare timestamps to avoid issues with DateTime
|
|
|
|
|
+ $timestamp = $dateTime->format('U') . '.' . $dateTime->format('U');
|
|
|
|
|
+ $bsonTimestamp = $bsonDateTime->format('U') . '.' . $bsonDateTime->format('U');
|
|
|
|
|
+ $this->assertSame((float) $timestamp, (float) $bsonTimestamp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testCreateWithBsonDate()
|
|
public function testCreateWithBsonDate()
|