Commit 59367751 authored by Jeremy Mikola's avatar Jeremy Mikola

Rename and reorder CreateIndexes tests

parent aef1ef7c
......@@ -8,27 +8,27 @@ class CreateIndexesTest extends TestCase
{
/**
* @expectedException MongoDB\Exception\InvalidArgumentException
* @expectedExceptionMessage $indexes is empty
* @expectedExceptionMessage $indexes is not a list (unexpected index: "1")
*/
public function testCreateIndexesRequiresAtLeastOneIndex()
public function testConstructorIndexesArgumentMustBeAList()
{
new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), []);
new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), [1 => ['key' => ['x' => 1]]]);
}
/**
* @expectedException MongoDB\Exception\InvalidArgumentException
* @expectedExceptionMessage $indexes is not a list (unexpected index: "1")
* @expectedExceptionMessage $indexes is empty
*/
public function testConstructorIndexesArgumentMustBeAList()
public function testConstructorRequiresAtLeastOneIndex()
{
new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), [1 => ['key' => ['x' => 1]]]);
new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), []);
}
/**
* @expectedException MongoDB\Exception\InvalidArgumentException
* @dataProvider provideInvalidIndexSpecificationTypes
*/
public function testCreateIndexesRequiresIndexSpecificationsToBeAnArray($index)
public function testConstructorRequiresIndexSpecificationsToBeAnArray($index)
{
new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), [$index]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment