Browse Source

Skipping Oracle tests if not using Oracle configuration.

Renan Gonçalves 15 years ago
parent
commit
423fa8127e
1 changed files with 4 additions and 20 deletions
  1. 4 20
      lib/Cake/Test/Case/Model/Datasource/Database/OracleTest.php

+ 4 - 20
lib/Cake/Test/Case/Model/Datasource/Database/OracleTest.php

@@ -39,31 +39,19 @@ class DboOracleTest extends CakeTestCase {
  * @return void
  */
 	function setUp() {
-		//$this->_initDb();
+		$this->Dbo = ConnectionManager::getDataSource('test');
+		if (!($this->Dbo instanceof Oracle)) {
+			$this->markTestSkipped('The Oracle extension is not available.');
+		}
 	}
 
 /**
- * skip method
- *
- * @access public
- * @return void
- */
-    function skip() {
-    	//$this->_initDb();
-    	$this->skipUnless($this->db->config['datasource'] == 'Database/Oracle', '%s Oracle connection not available');
-    }
-
-/**
  * testLastErrorStatement method
  *
  * @access public
  * @return void
  */
 	function testLastErrorStatement() {
-		if ($this->skip('testLastErrorStatement')) {
-			return;
-		}
-
 		$this->expectError();
 		$this->db->execute("SELECT ' FROM dual");
 		$e = $this->db->lastError();
@@ -78,10 +66,6 @@ class DboOracleTest extends CakeTestCase {
  * @return void
  */
 	function testLastErrorConnect() {
-		if ($this->skip('testLastErrorConnect')) {
-			return;
-		}
-
 		$config = $this->db->config;
 		$old_pw = $this->db->config['password'];
 		$this->db->config['password'] = 'keepmeout';