public function __construct() { $loader = new Twig_Loader_Filesystem(__DIR__ . '/../views'); $this->twig = new Twig_Environment($loader); $connect = SinglePdoConnect::getInstance(); ActiveRecord::setPDO($connect); }
public function testUpdate() { $STMTstub = $this->getMock('PDOStatement'); $STMTstub->expects($this->never())->method('execute'); $connect = $this->getMock('PDOMock', ['prepare', 'lastInsertId']); $connect->expects($this->never())->method('prepare')->will($this->returnValue($STMTstub)); ActiveRecord::setPDO($connect); $vendor = new Vendor(); $this->assertEquals($vendor->update(), 'Cannot update(): id is not defined'); }