소스 검색

Merge pull request #78 from alcaeus/use-latest-pecl

Use "latest" instead of version for pecl installs
Andreas 9 년 전
부모
커밋
14dddf0dfa
2개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      .travis.yml
  2. 6 1
      tests/Alcaeus/MongoDbAdapter/Mongo/MongoDateTest.php

+ 2 - 2
.travis.yml

@@ -7,12 +7,12 @@ php:
   - 7.0
 
 env:
-  - DRIVER_VERSION=1.1.1
+  - DRIVER_VERSION=stable
 
 matrix:
   include:
     - php: 5.6
-      env: DRIVER_VERSION=1.1.1 LEGACY_DRIVER_VERSION=1.6.12
+      env: DRIVER_VERSION=stable LEGACY_DRIVER_VERSION=stable
 
 addons:
   apt:

+ 6 - 1
tests/Alcaeus/MongoDbAdapter/Mongo/MongoDateTest.php

@@ -38,7 +38,12 @@ class MongoDateTest extends TestCase
         $this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $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()