Commit 7c17b348 authored by Jeremy Mikola's avatar Jeremy Mikola

Unit tests for ListDatabases and ListIndexes options

parent 5c7ce60a
<?php
namespace MongoDB\Tests\Operation;
use MongoDB\Operation\ListDatabases;
class ListDatabasesTest extends TestCase
{
/**
* @expectedException MongoDB\Exception\InvalidArgumentException
* @dataProvider provideInvalidConstructorOptions
*/
public function testConstructorOptionTypeChecks(array $options)
{
new ListDatabases($options);
}
public function provideInvalidConstructorOptions()
{
$options = [];
foreach ($this->getInvalidIntegerValues() as $value) {
$options[][] = ['maxTimeMS' => $value];
}
return $options;
}
}
<?php
namespace MongoDB\Tests\Operation;
use MongoDB\Operation\ListIndexes;
class ListIndexesTest extends TestCase
{
/**
* @expectedException MongoDB\Exception\InvalidArgumentException
* @dataProvider provideInvalidConstructorOptions
*/
public function testConstructorOptionTypeChecks(array $options)
{
new ListIndexes($this->getDatabaseName(), $this->getCollectionName(), $options);
}
public function provideInvalidConstructorOptions()
{
$options = [];
foreach ($this->getInvalidIntegerValues() as $value) {
$options[][] = ['maxTimeMS' => $value];
}
return $options;
}
}
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