Skip to content

Commit

Permalink
mock getAdapter()->getDriver()
Browse files Browse the repository at this point in the history
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
  • Loading branch information
samsonasik committed Aug 5, 2020
1 parent fd6e67b commit c22baae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Adapter/DbSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ public function setUp()
->with($this->isInstanceOf('Laminas\Db\Sql\Select'))
->will($this->returnValue($this->mockStatement));

$this->mockAdapter = $this->getMockBuilder('Laminas\Db\Adapter\AdapterInterface')->getMock();
$this->mockAdapter->expects($this->any())
->method('getDriver')
->will($this->returnValue($mockDriver));
$this->mockSql
->expects($this->any())
->method('getAdapter')
->will($this->returnValue($this->mockAdapter));

$this->mockSelect = $this->createMock('Laminas\Db\Sql\Select');
$this->mockSelectCount = $this->createMock('Laminas\Db\Sql\Select');
$this->dbSelect = new DbSelect($this->mockSelect, $this->mockSql);
Expand Down

0 comments on commit c22baae

Please sign in to comment.