/** * Run test fetchItem method * * @return void */ public function testFetchItem() { $adapterMock = $this->getMock('Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql', ['query'], [], '', false); $this->selectMock->expects($this->once())->method('getConnection')->will($this->returnValue($adapterMock)); $adapterMock->expects($this->once())->method('query')->will($this->returnValue($this->fetchStmtMock)); $this->fetchStmtMock->expects($this->once())->method('fetch')->will($this->returnValue(null)); $this->assertEquals([], $this->query->fetchItem()); }
/** * Run test fetchItem method * * @return void */ public function testFetchItem() { $adapterMock = $this->getMockForAbstractClass('Zend_Db_Adapter_Abstract', [], '', false, true, true, ['query']); $this->selectMock->expects($this->once())->method('getAdapter')->will($this->returnValue($adapterMock)); $adapterMock->expects($this->once())->method('query')->will($this->returnValue($this->fetchStmtMock)); $this->fetchStmtMock->expects($this->once())->method('fetch')->will($this->returnValue(null)); $this->assertEquals([], $this->query->fetchItem()); }