From 8b969d039819fce0a0c765dbac045ed315e5b971 Mon Sep 17 00:00:00 2001 From: zYne Date: Mon, 27 Nov 2006 22:49:13 +0000 Subject: [PATCH] added tests for oracle datadict driver --- tests/DataDict/OracleTestCase.php | 85 +++++++++++++++++++++++++++++++ tests/run.php | 26 ++++++++-- 2 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 tests/DataDict/OracleTestCase.php diff --git a/tests/DataDict/OracleTestCase.php b/tests/DataDict/OracleTestCase.php new file mode 100644 index 000000000..17b53f924 --- /dev/null +++ b/tests/DataDict/OracleTestCase.php @@ -0,0 +1,85 @@ + 'integer', 'length' => 20, 'fixed' => false); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'NUMBER(20)'); + + $a['length'] = 4; + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'NUMBER(4)'); + + $a['length'] = 2; + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'NUMBER(2)'); + } + + public function testGetNativeDefinitionSupportsFloatType() { + $a = array('type' => 'float', 'length' => 20, 'fixed' => false); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'NUMBER'); + } + public function testGetNativeDefinitionSupportsBooleanType() { + $a = array('type' => 'boolean', 'fixed' => false); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'NUMBER(1)'); + } + public function testGetNativeDefinitionSupportsDateType() { + $a = array('type' => 'date', 'fixed' => false); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'DATE'); + } + public function testGetNativeDefinitionSupportsTimestampType() { + $a = array('type' => 'timestamp', 'fixed' => false); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'DATE'); + } + public function testGetNativeDefinitionSupportsTimeType() { + $a = array('type' => 'time', 'fixed' => false); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'DATE'); + } + public function testGetNativeDefinitionSupportsClobType() { + $a = array('type' => 'clob'); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'CLOB'); + } + public function testGetNativeDefinitionSupportsBlobType() { + $a = array('type' => 'blob'); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'BLOB'); + } + public function testGetNativeDefinitionSupportsCharType() { + $a = array('type' => 'char', 'length' => 10); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'CHAR(10)'); + } + public function testGetNativeDefinitionSupportsVarcharType() { + $a = array('type' => 'varchar', 'length' => 10); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'VARCHAR2(10)'); + } + public function testGetNativeDefinitionSupportsArrayType() { + $a = array('type' => 'array', 'length' => 40); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'VARCHAR2(40)'); + } + public function testGetNativeDefinitionSupportsStringType() { + $a = array('type' => 'string'); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'VARCHAR2(16777215)'); + } + public function testGetNativeDefinitionSupportsArrayType2() { + $a = array('type' => 'array'); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'VARCHAR2(16777215)'); + } + public function testGetNativeDefinitionSupportsObjectType() { + $a = array('type' => 'object'); + + $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'VARCHAR2(16777215)'); + } +} diff --git a/tests/run.php b/tests/run.php index 0ddeae19f..6e98c89be 100644 --- a/tests/run.php +++ b/tests/run.php @@ -61,6 +61,9 @@ require_once('EnumTestCase.php'); require_once('DataDictSqliteTestCase.php'); require_once('DataDict/PgsqlTestCase.php'); +require_once('DataDict/SqliteTestCase.php'); +require_once('DataDict/MysqlTestCase.php'); +require_once('DataDict/OracleTestCase.php'); require_once('ExportTestCase.php'); require_once('ExportMysqlTestCase.php'); @@ -76,24 +79,37 @@ require_once('TransactionFirebirdTestCase.php'); require_once('TransactionMssqlTestCase.php'); require_once('TransactionSqliteTestCase.php'); +require_once('Connection/MysqlTestCase.php'); + require_once('CustomResultSetOrderTestCase.php'); error_reporting(E_ALL); print '
';
 
 $test = new GroupTest('Doctrine Framework Unit Tests');
- /**
-$test->addTestCase(new Doctrine_Configurable_TestCase());
+
+
+
+$test->addTestCase(new Doctrine_Connection_Mysql_TestCase());
 
 $test->addTestCase(new Doctrine_Export_Mysql_TestCase());
 
+$test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
+
+$test->addTestCase(new Doctrine_DataDict_Mysql_TestCase());
+
+$test->addTestCase(new Doctrine_DataDict_Oracle_TestCase());
+ /**
+$test->addTestCase(new Doctrine_DataDict_Sqlite_TestCase());
+$test->addTestCase(new Doctrine_Configurable_TestCase());
+
+
 $test->addTestCase(new Doctrine_Export_Firebird_TestCase());
 
 $test->addTestCase(new Doctrine_Export_Pgsql_TestCase());
 
 $test->addTestCase(new Doctrine_Export_Oracle_TestCase());
 
-$test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
 
 $test->addTestCase(new Doctrine_Transaction_TestCase());
 
@@ -108,7 +124,7 @@ $test->addTestCase(new Doctrine_Transaction_Firebird_TestCase());
 $test->addTestCase(new Doctrine_Transaction_Sqlite_TestCase());
 
 $test->addTestCase(new Doctrine_Transaction_Mssql_TestCase());
-*/
+/**
 $test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
 
 $test->addTestCase(new Doctrine_UnitOfWork_TestCase());
@@ -199,7 +215,7 @@ $test->addTestCase(new Doctrine_Query_Where_TestCase());
 $test->addTestCase(new Doctrine_Query_Limit_TestCase());
 
 $test->addTestCase(new Doctrine_Query_Select_TestCase());
-
+*/
 
 
 //$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());