/** * @covers ::getLastInsertId */ public function testGetLastInsertId() { $db = $this->getMock('Harp\\Query\\DB', array('getLastInsertId'), array('mysql:dbname=harp-orm/query;host=127.0.0.1', 'root')); $db->expects($this->once())->method('getLastInsertId')->will($this->returnValue('123')); $query = new Query\Insert($db); $id = $query->getLastInsertId(); $this->assertSame('123', $id); }