Ejemplo n.º 1
0
 protected function setUp()
 {
     $this->pdo = new Pdo('sqlite::memory:', null, null, array(Pdo::ATTR_ERRMODE => Pdo::ERRMODE_EXCEPTION));
     $this->pdo->exec('CREATE TABLE test(id INTEGER PRIMARY KEY, a TEXT)');
     $this->fake = $this->pdo->prepare('SELECT * FROM test WHERE a = :b');
     $this->real = $this->getPropertyValue($this->fake, 'statement');
 }
Ejemplo n.º 2
0
 public function testQuery()
 {
     $this->pdo->exec('CREATE TABLE test(id INTEGER PRIMARY KEY)');
     $statement = $this->pdo->query('SELECT * FROM test');
     $this->assertInstanceOf('Herrera\\Pdo\\PdoStatement', $statement);
 }