Ejemplo n.º 1
0
 public function __construct()
 {
     $loader = new Twig_Loader_Filesystem(__DIR__ . '/../views');
     $this->twig = new Twig_Environment($loader);
     $connect = SinglePdoConnect::getInstance();
     ActiveRecord::setPDO($connect);
 }
Ejemplo n.º 2
0
 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');
 }