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'); }
public function testPrepareError() { $this->pdo->setAttribute(Pdo::ATTR_ERRMODE, Pdo::ERR_NONE); $this->assertFalse($this->pdo->prepare('wat')); }