/** * @return void */ public function testLoadDataFromSelect() { $select = $this->getMock('\\Magento\\Framework\\DB\\Select', [], [], '', false); $data = [['id' => 1], ['id' => 2]]; $this->pdoMysql->expects($this->any())->method('fetchAll')->with($select)->willReturn($data); $this->assertSame($data, $this->adapterMysql->loadDataFromSelect($select)); }
/** * @param string $sourceDocumentName * @param \Magento\Framework\DB\Select $select * @param int $pageNumber * @return array */ protected function getRecords($sourceDocumentName, \Magento\Framework\DB\Select $select, $pageNumber) { $select->limit($this->source->getPageSize($sourceDocumentName), $pageNumber * $this->source->getPageSize($sourceDocumentName)); return $this->sourceAdapter->loadDataFromSelect($select); }