本文整理匯總了PHP中MDB2_Driver_Common::expectError方法的典型用法代碼示例。如果您正苦於以下問題:PHP MDB2_Driver_Common::expectError方法的具體用法?PHP MDB2_Driver_Common::expectError怎麽用?PHP MDB2_Driver_Common::expectError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MDB2_Driver_Common
的用法示例。
在下文中一共展示了MDB2_Driver_Common::expectError方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: manualSetUp
/**
* Establishes the class properties for each test
*
* Can not use setUp() because we are using a dataProvider to get multiple
* MDB2 objects per test.
*
* @param array $ci an associative array with two elements. The "dsn"
* element must contain an array of DSN information.
* The "options" element must be an array of connection
* options.
*/
protected function manualSetUp($ci)
{
$this->db = MDB2::factory($ci['dsn'], $ci['options']);
if (MDB2::isError($this->db)) {
$this->markTestSkipped($this->db->getMessage());
}
$this->dsn = self::$dsns[$this->db->phptype]['dsn'];
$this->options = self::$dsns[$this->db->phptype]['options'];
$this->database = $this->db->getDatabase();
$this->db->setDatabase($this->database);
if ($this->database == ':memory:') {
// Disable messages from other packages while building schema.
$prior = error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
build_schema($this->db);
error_reporting($prior);
}
$this->db->expectError(MDB2_ERROR_UNSUPPORTED);
$this->clearTables();
}