Exemplo n.º 1
0
 public function testPreparesQueryWithOverrideConfig()
 {
     $driver = $this->getMock('Orno\\Db\\Driver\\Pdo');
     $config = ['database' => 'database', 'username' => 'username', 'password' => 'password'];
     $driver->expects($this->once())->method('prepareQuery')->with($this->equalTo('SELECT * FROM test_table'))->will($this->returnValue($driver));
     $driver->expects($this->once())->method('connect')->with($this->equalTo($config))->will($this->returnValue($driver));
     $q = new Query($driver, $config);
     $this->assertInstanceOf('Orno\\Db\\Query', $q->prepare('SELECT * FROM test_table'));
 }