Fix AbstractProvider tests

This commit is contained in:
Tim Nagel 2014-06-24 10:30:31 +10:00
parent 2437a098ba
commit f6264f4149

View file

@ -54,6 +54,11 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
->with($queryBuilder) ->with($queryBuilder)
->will($this->returnValue($nbObjects)); ->will($this->returnValue($nbObjects));
$this->indexable->expects($this->any())
->method('isObjectIndexable')
->with('index', 'type', $this->anything())
->will($this->returnValue(true));
$providerInvocationOffset = 2; $providerInvocationOffset = 2;
foreach ($objectsByIteration as $i => $objects) { foreach ($objectsByIteration as $i => $objects) {
@ -106,6 +111,11 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
->method('fetchSlice') ->method('fetchSlice')
->will($this->returnValue($objects)); ->will($this->returnValue($objects));
$this->indexable->expects($this->any())
->method('isObjectIndexable')
->with('index', 'type', $this->anything())
->will($this->returnValue(true));
$this->objectManager->expects($this->never()) $this->objectManager->expects($this->never())
->method('clear'); ->method('clear');
@ -127,6 +137,11 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
->method('fetchSlice') ->method('fetchSlice')
->will($this->returnValue($objects)); ->will($this->returnValue($objects));
$this->indexable->expects($this->any())
->method('isObjectIndexable')
->with('index', 'type', $this->anything())
->will($this->returnValue(true));
$loggerClosureInvoked = false; $loggerClosureInvoked = false;
$loggerClosure = function () use (&$loggerClosureInvoked) { $loggerClosure = function () use (&$loggerClosureInvoked) {
$loggerClosureInvoked = true; $loggerClosureInvoked = true;
@ -154,6 +169,11 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
->method('fetchSlice') ->method('fetchSlice')
->will($this->returnValue($objects)); ->will($this->returnValue($objects));
$this->indexable->expects($this->any())
->method('isObjectIndexable')
->with('index', 'type', $this->anything())
->will($this->returnValue(true));
$this->objectPersister->expects($this->any()) $this->objectPersister->expects($this->any())
->method('insertMany') ->method('insertMany')
->will($this->throwException($this->getMockBulkResponseException())); ->will($this->throwException($this->getMockBulkResponseException()));