diff --git a/Tests/IndexManagerTest.php b/Tests/IndexManagerTest.php new file mode 100644 index 0000000..897c3bb --- /dev/null +++ b/Tests/IndexManagerTest.php @@ -0,0 +1,42 @@ +indexManager = new IndexManager(array('index1' => 'test1', 'index2' => 'test2'), 'defaultIndex'); + } + + public function testThatWeCanGetAllIndexes() + { + $this->assertEquals(array('index1' => 'test1', 'index2' => 'test2'), $this->indexManager->getAllIndexes()); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testThatWeCannotGetIndexWhichWasNotSet() + { + $this->indexManager->getIndex('index8'); + } + + public function testThatWeCanGetDefaultIndex() + { + $this->assertEquals('defaultIndex', $this->indexManager->getIndex(false)); + $this->assertEquals('defaultIndex', $this->indexManager->getDefaultIndex()); + } + + public function testThatWeCanGetIndex() + { + $this->assertEquals('test2', $this->indexManager->getIndex('index2')); + } +} diff --git a/Tests/ReseterTest.php b/Tests/ReseterTest.php index 20f9370..233acea 100644 --- a/Tests/ReseterTest.php +++ b/Tests/ReseterTest.php @@ -47,7 +47,7 @@ class ReseterTest extends \PHPUnit_Framework_TestCase { if (!class_exists('Elastica_Exception_Response') || !class_exists('Elastica_Response')) { - $this->markTestSkipped('The Elastica library classes are not available'); + $this->markTestSkipped('The Elastica library classes are not available'); } }