Skip to content
Browse files

Updated test to reflect change in IndexManager constrcutor arguments

  • Loading branch information...
1 parent 2e3d67f commit ce5223f85dccd0d3df96201da490353d5f3a35fe @richardmiller richardmiller committed Aug 14, 2012
Showing with 11 additions and 2 deletions.
  1. +1 −1 IndexManager.php
  2. +10 −1 Tests/IndexManagerTest.php
View
2 IndexManager.php
@@ -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
11 Tests/IndexManagerTest.php
@@ -17,7 +17,16 @@ public function setUp()
'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()

0 comments on commit ce5223f

Please sign in to comment.
Something went wrong with that request. Please try again.