Преглед изворни кода

Fix tests failing due to newer MongoDB version

Andreas Braun пре 6 година
родитељ
комит
b987035489
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      tests/Alcaeus/MongoDbAdapter/Mongo/MongoDBTest.php

+ 5 - 1
tests/Alcaeus/MongoDbAdapter/Mongo/MongoDBTest.php

@@ -240,6 +240,8 @@ class MongoDBTest extends TestCase
 
     public function testExecute()
     {
+        $this->skipTestIf(version_compare($this->getServerVersion(), '4.2.0', '>='), 'Eval no longer works on MongoDB 4.2.0 and newer');
+
         $db = $this->getDatabase();
         $document = ['foo' => 'bar'];
         $this->getCollection()->insert($document);
@@ -384,11 +386,13 @@ class MongoDBTest extends TestCase
             'nIndexesWas' => 1,
             'ok' => 1.0
         ];
-        $this->assertSame($expected, $this->getDatabase()->dropCollection('test'));
+        $this->assertEquals($expected, $this->getDatabase()->dropCollection('test'));
     }
 
     public function testRepair()
     {
+        $this->skipTestIf(version_compare($this->getServerVersion(), '4.2.0', '>='), 'The "repairDatabase" has been removed in MongoDB 4.2.0');
+
         $this->assertSame(['ok' => 1.0], $this->getDatabase()->repair());
     }
 }