コード例 #1
0
 /**
  * @expectedException \Doctrine\DBAL\Driver\PDOException
  */
 public function testThrowsWrappedExceptionOnPrepare()
 {
     // Emulated prepared statements have to be disabled for this test
     // so that PDO actually communicates with the database server to check the query.
     $this->driverConnection->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false);
     $this->driverConnection->prepare('foo');
     // Some PDO adapters like PostgreSQL do not check the query server-side
     // even though emulated prepared statements are disabled,
     // so an exception is thrown only eventually.
     // Skip the test otherwise.
     $this->markTestSkipped(sprintf('The PDO adapter %s does not check the query to be prepared server-side, ' . 'so no assertions can be made.', $this->_conn->getDriver()->getName()));
 }
コード例 #2
0
 /**
  * {@inheritdoc}non-PHPdoc)
  */
 function prepare($prepareString)
 {
     $prepareString = $this->removeTableAlias($prepareString);
     $prepareString = $this->normalizeCount($prepareString);
     return parent::prepare($prepareString);
 }