Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 /**
  * @param \Magento\Framework\DB\Select $select
  * @param int $pageNumber
  * @return array
  */
 protected function getRecords(\Magento\Framework\DB\Select $select, $pageNumber)
 {
     $select->limit($this->source->getPageSize(), $pageNumber * $this->source->getPageSize());
     return $this->sourceAdapter->loadDataFromSelect($select);
 }