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