mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 02:26:17 +00:00
fixes #4671, skip DboOracle tests when driver is not set. Clean up other dbo tests to be consistent
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6908 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
10d555d5e2
commit
bc6a8e03b5
4 changed files with 9 additions and 11 deletions
|
@ -117,8 +117,7 @@ class DboMssqlTest extends CakeTestCase {
|
|||
*/
|
||||
function skip() {
|
||||
$this->_initDb();
|
||||
$db =& ConnectionManager::getDataSource('test_suite');
|
||||
$this->skipif ($db->config['driver'] != 'mssql', 'SQL Server connection not available');
|
||||
$this->skipif ($this->db->config['driver'] != 'mssql', 'SQL Server connection not available');
|
||||
}
|
||||
/**
|
||||
* Sets up a Dbo class instance for testing
|
||||
|
|
|
@ -120,8 +120,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
*/
|
||||
function skip() {
|
||||
$this->_initDb();
|
||||
$db =& ConnectionManager::getDataSource('test_suite');
|
||||
$this->skipif($db->config['driver'] != 'mysql', 'MySQL connection not available');
|
||||
$this->skipif($this->db->config['driver'] != 'mysql', 'MySQL connection not available');
|
||||
}
|
||||
/**
|
||||
* Sets up a Dbo class instance for testing
|
||||
|
|
|
@ -31,11 +31,12 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
|||
require_once LIBS.'model'.DS.'datasources'.DS.'dbo_source.php';
|
||||
|
||||
class DboOracleTest extends CakeTestCase {
|
||||
|
||||
function setUp() {
|
||||
$this->db = ConnectionManager::getDataSource('default');
|
||||
|
||||
function skip() {
|
||||
$this->_initDb();
|
||||
$this->skipif($this->db->config['driver'] != 'oracle', 'Oracle connection not available');
|
||||
}
|
||||
|
||||
|
||||
function testLastErrorStatement() {
|
||||
$this->expectError();
|
||||
$this->db->execute("SELECT ' FROM dual");
|
||||
|
@ -43,7 +44,7 @@ class DboOracleTest extends CakeTestCase {
|
|||
$r = 'ORA-01756: quoted string not properly terminated';
|
||||
$this->assertEqual($e, $r);
|
||||
}
|
||||
|
||||
|
||||
function testLastErrorConnect() {
|
||||
$config = $this->db->config;
|
||||
$this->db->config['password'] = 'keepmeout';
|
||||
|
@ -53,7 +54,7 @@ class DboOracleTest extends CakeTestCase {
|
|||
$this->assertEqual($e, $r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -115,7 +115,6 @@ class DboPostgresTest extends CakeTestCase {
|
|||
*/
|
||||
function skip() {
|
||||
$this->_initDb();
|
||||
$db = ConnectionManager::getDataSource('test_suite');
|
||||
$this->skipif ($this->db->config['driver'] != 'postgres', 'PostgreSQL connection not available');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue