Exemple #1
0
 public function testGetSelectSql()
 {
     $adapterMock = $this->getMock('Zend_Db_Adapter_Pdo_Mysql', ['select'], [], '', false);
     $selectMock = $this->getMock('Magento\\Framework\\DB\\Select', ['__toString'], ['adapter' => $adapterMock]);
     $adapterMock->expects($this->once())->method('select')->will($this->returnValue($selectMock));
     $sql = 'query';
     $selectMock->expects($this->once())->method('__toString')->will($this->returnValue($sql));
     $this->collection->setConnection($adapterMock);
     $this->assertEquals($sql, $this->collection->getSelectSql(true));
     $this->assertEquals($selectMock, $this->collection->getSelectSql());
 }