Improve test coverage
This commit is contained in:
parent
6c4740b292
commit
090f02b05d
6 changed files with 203 additions and 5 deletions
|
|
@ -58,6 +58,22 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
$repository->findPaginated($testQuery);
|
||||
}
|
||||
|
||||
public function testThatCreatePaginatorCreatesAPaginatorViaFinder()
|
||||
{
|
||||
$testQuery = 'Test Query';
|
||||
|
||||
/** @var $typeMock \PHPUnit_Framework_MockObject_MockObject|\FOS\ElasticaBundle\Finder\TransformedFinder */
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$finderMock->expects($this->once())
|
||||
->method('createPaginatorAdapter')
|
||||
->with($this->equalTo($testQuery));
|
||||
|
||||
$repository = new Repository($finderMock);
|
||||
$repository->createPaginatorAdapter($testQuery);
|
||||
}
|
||||
|
||||
public function testThatFindHybridCallsFindHybridOnFinder()
|
||||
{
|
||||
$testQuery = 'Test Query';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue