Example #1
0
 public function testSelectOne()
 {
     $select = $this->getMockBuilder('T4webBase\\Db\\Select')->disableOriginalConstructor()->getMock();
     $result = $this->getMock('Zend\\Db\\ResultSet\\ResultSet');
     $this->tableGatewayMock->expects($this->once())->method('selectWith')->will($this->returnValue($result));
     $select->expects($this->once())->method('limit')->with($this->equalTo(1))->will($this->returnSelf());
     $select->expects($this->once())->method('offset')->with($this->equalTo(0))->will($this->returnSelf());
     $select->expects($this->once())->method('getZendSelect')->will($this->returnValue($this->getMock('Zend\\Db\\Sql\\Select')));
     $result->expects($this->once())->method('toArray')->will($this->returnValue([]));
     $this->table->selectOne($select);
 }