Browse Source

Harden batchInsert test

Andreas Braun 10 years ago
parent
commit
41c3c7901d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tests/Alcaeus/MongoDbAdapter/MongoCollectionTest.php

+ 1 - 1
tests/Alcaeus/MongoDbAdapter/MongoCollectionTest.php

@@ -176,7 +176,7 @@ class MongoCollectionTest extends TestCase
 
 
     public function testBatchInsertException()
     public function testBatchInsertException()
     {
     {
-        $this->setExpectedException('MongoDuplicateKeyException', 'E11000 duplicate key error index: mongo-php-adapter.test.$_id_');
+        $this->setExpectedExceptionRegExp('MongoDuplicateKeyException', '/E11000 duplicate key error .* mongo-php-adapter.test.*_id_/');
 
 
         $id = new \MongoId();
         $id = new \MongoId();
         $documents = [['_id' => $id, 'foo' => 'bar'], ['_id' => $id, 'foo' => 'bleh']];
         $documents = [['_id' => $id, 'foo' => 'bar'], ['_id' => $id, 'foo' => 'bleh']];