/** * Run test getSize method * * @return void */ public function testGetSize() { $adapterMock = $this->getMock('Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql', ['fetchOne'], [], '', false); $this->selectMock->expects($this->once())->method('columns')->with('COUNT(*)'); $this->selectMock->expects($this->once())->method('getConnection')->will($this->returnValue($adapterMock)); $adapterMock->expects($this->once())->method('fetchOne')->will($this->returnValue(10.689)); $this->assertEquals(10, $this->query->getSize()); }
/** * Run test getSize method * * @return void */ public function testGetSize() { $adapterMock = $this->getMockForAbstractClass('Zend_Db_Adapter_Abstract', [], '', false, true, true, ['fetchOne']); $this->selectMock->expects($this->once())->method('columns')->with('COUNT(*)'); $this->selectMock->expects($this->once())->method('getAdapter')->will($this->returnValue($adapterMock)); $adapterMock->expects($this->once())->method('fetchOne')->will($this->returnValue(10.689)); $this->assertEquals(10, $this->query->getSize()); }