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() {
|
function skip() {
|
||||||
$this->_initDb();
|
$this->_initDb();
|
||||||
$db =& ConnectionManager::getDataSource('test_suite');
|
$this->skipif ($this->db->config['driver'] != 'mssql', 'SQL Server connection not available');
|
||||||
$this->skipif ($db->config['driver'] != 'mssql', 'SQL Server connection not available');
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Sets up a Dbo class instance for testing
|
* Sets up a Dbo class instance for testing
|
||||||
|
|
|
@ -120,8 +120,7 @@ class DboMysqlTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function skip() {
|
function skip() {
|
||||||
$this->_initDb();
|
$this->_initDb();
|
||||||
$db =& ConnectionManager::getDataSource('test_suite');
|
$this->skipif($this->db->config['driver'] != 'mysql', 'MySQL connection not available');
|
||||||
$this->skipif($db->config['driver'] != 'mysql', 'MySQL connection not available');
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Sets up a Dbo class instance for testing
|
* 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';
|
require_once LIBS.'model'.DS.'datasources'.DS.'dbo_source.php';
|
||||||
|
|
||||||
class DboOracleTest extends CakeTestCase {
|
class DboOracleTest extends CakeTestCase {
|
||||||
|
|
||||||
function setUp() {
|
function skip() {
|
||||||
$this->db = ConnectionManager::getDataSource('default');
|
$this->_initDb();
|
||||||
|
$this->skipif($this->db->config['driver'] != 'oracle', 'Oracle connection not available');
|
||||||
}
|
}
|
||||||
|
|
||||||
function testLastErrorStatement() {
|
function testLastErrorStatement() {
|
||||||
$this->expectError();
|
$this->expectError();
|
||||||
$this->db->execute("SELECT ' FROM dual");
|
$this->db->execute("SELECT ' FROM dual");
|
||||||
|
@ -43,7 +44,7 @@ class DboOracleTest extends CakeTestCase {
|
||||||
$r = 'ORA-01756: quoted string not properly terminated';
|
$r = 'ORA-01756: quoted string not properly terminated';
|
||||||
$this->assertEqual($e, $r);
|
$this->assertEqual($e, $r);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testLastErrorConnect() {
|
function testLastErrorConnect() {
|
||||||
$config = $this->db->config;
|
$config = $this->db->config;
|
||||||
$this->db->config['password'] = 'keepmeout';
|
$this->db->config['password'] = 'keepmeout';
|
||||||
|
@ -53,7 +54,7 @@ class DboOracleTest extends CakeTestCase {
|
||||||
$this->assertEqual($e, $r);
|
$this->assertEqual($e, $r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,6 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function skip() {
|
function skip() {
|
||||||
$this->_initDb();
|
$this->_initDb();
|
||||||
$db = ConnectionManager::getDataSource('test_suite');
|
|
||||||
$this->skipif ($this->db->config['driver'] != 'postgres', 'PostgreSQL connection not available');
|
$this->skipif ($this->db->config['driver'] != 'postgres', 'PostgreSQL connection not available');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue