Updated test to reflect change in IndexManager constrcutor arguments

This commit is contained in:
Richard Miller 2012-08-14 10:04:20 +01:00
parent 2e3d67fdc7
commit ce5223f85d
2 changed files with 11 additions and 2 deletions

View file

@ -13,7 +13,7 @@ class IndexManager
* @param array $indexesByName
* @param string $defaultIndexName
*/
public function __construct(array $indexesByName, $defaultIndex)
public function __construct(array $indexesByName, \Elastica_Index $defaultIndex)
{
$this->indexesByName = $indexesByName;
$this->defaultIndexName = $defaultIndex->getName();

View file

@ -17,7 +17,16 @@ class IndexManagerTest extends \PHPUnit_Framework_TestCase
'index1' => 'test1',
'index2' => 'test2',
);
$this->indexManager = new IndexManager($this->indexesByName, $this->defaultIndexName);
$defaultIndex = $this->getMockBuilder('Elastica_Index')
->disableOriginalConstructor()
->getMock();
$defaultIndex->expects($this->any())
->method('getName')
->will($this->returnValue($this->defaultIndexName));
$this->indexManager = new IndexManager($this->indexesByName, $defaultIndex);
}
public function testGetAllIndexes()