Jelajahi Sumber

Fix failing test

Andreas Braun 10 tahun lalu
induk
melakukan
1de9e827cf

+ 2 - 0
lib/Mongo/MongoCollection.php

@@ -513,6 +513,8 @@ class MongoCollection
             }
         } catch (\MongoDB\Driver\Exception\ConnectionException $e) {
             throw new MongoResultException($e->getMessage(), $e->getCode(), $e);
+        } catch (\MongoDB\Driver\Exception\RuntimeException $e) {
+            throw new MongoResultException($e->getMessage(), $e->getCode(), $e);
         } catch (\MongoDB\Driver\Exception\Exception $e) {
             ExceptionConverter::toLegacy($e);
         }

+ 3 - 4
tests/Alcaeus/MongoDbAdapter/MongoCollectionTest.php

@@ -923,15 +923,14 @@ class MongoCollectionTest extends TestCase
 
     public function testFindAndModifyResultException()
     {
-        $id = '54203e08d51d4a1f868b456e';
         $collection = $this->getCollection();
 
         $this->setExpectedException('MongoResultException');
 
-        $document = $collection->findAndModify(
+        $collection->findAndModify(
             array("inprogress" => false, "name" => "Next promo"),
-            array('$pop' => array("tasks" => -1)),
-            array("tasks" => array('$pop' => array("stuff"))),
+            array('$unsupportedOperator' => array("tasks" => -1)),
+            array("tasks" => true),
             array("new" => true)
         );
     }