Updated test to reflect change in IndexManager constrcutor arguments
This commit is contained in:
parent
2e3d67fdc7
commit
ce5223f85d
|
@ -13,7 +13,7 @@ class IndexManager
|
||||||
* @param array $indexesByName
|
* @param array $indexesByName
|
||||||
* @param string $defaultIndexName
|
* @param string $defaultIndexName
|
||||||
*/
|
*/
|
||||||
public function __construct(array $indexesByName, $defaultIndex)
|
public function __construct(array $indexesByName, \Elastica_Index $defaultIndex)
|
||||||
{
|
{
|
||||||
$this->indexesByName = $indexesByName;
|
$this->indexesByName = $indexesByName;
|
||||||
$this->defaultIndexName = $defaultIndex->getName();
|
$this->defaultIndexName = $defaultIndex->getName();
|
||||||
|
|
|
@ -17,7 +17,16 @@ class IndexManagerTest extends \PHPUnit_Framework_TestCase
|
||||||
'index1' => 'test1',
|
'index1' => 'test1',
|
||||||
'index2' => 'test2',
|
'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()
|
public function testGetAllIndexes()
|
||||||
|
|
Loading…
Reference in a new issue