Skip to content

Commit 797ef70

Browse files
committed
Merge pull request #49
2 parents ce26ec3 + c50d9a6 commit 797ef70

8 files changed

+362
-204
lines changed

src/Operation/CreateIndexes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use MongoDB\Driver\Command;
66
use MongoDB\Driver\Server;
77
use MongoDB\Driver\BulkWrite as Bulk;
8+
use MongoDB\Driver\WriteConcern;
89
use MongoDB\Exception\InvalidArgumentException;
910
use MongoDB\Exception\RuntimeException;
1011
use MongoDB\Exception\UnexpectedTypeException;
@@ -113,6 +114,6 @@ private function executeLegacy(Server $server)
113114
$bulk->insert($index);
114115
}
115116

116-
$server->executeBulkWrite($this->databaseName . '.system.indexes', $bulk);
117+
$server->executeBulkWrite($this->databaseName . '.system.indexes', $bulk, new WriteConcern(1));
117118
}
118119
}

tests/Collection/CollectionFunctionalTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ public function testDrop()
6161
$this->assertCollectionCount($this->getNamespace(), 0);
6262
}
6363

64+
/**
65+
* @expectedException MongoDB\Exception\InvalidArgumentException
66+
* @todo Move this to a unit test once Manager can be mocked
67+
*/
68+
public function testDropIndexShouldNotAllowWildcardCharacter()
69+
{
70+
$this->collection->dropIndex('*');
71+
}
72+
6473
public function testFindOne()
6574
{
6675
$this->createFixtures(5);

tests/Collection/IndexManagementFunctionalTest.php

Lines changed: 0 additions & 193 deletions
This file was deleted.

0 commit comments

Comments
 (0)