added tests for oracle datadict driver
This commit is contained in:
parent
c6f5546fdd
commit
8b969d0398
85
tests/DataDict/OracleTestCase.php
Normal file
85
tests/DataDict/OracleTestCase.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
class Doctrine_DataDict_Oracle_TestCase extends Doctrine_Driver_UnitTestCase {
|
||||
public function __construct() {
|
||||
parent::__construct('oci');
|
||||
}
|
||||
public function testGetNativeDefinitionSupportsIntegerType() {
|
||||
$a = array('type' => '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)');
|
||||
}
|
||||
}
|
@ -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 '<pre>';
|
||||
|
||||
$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());
|
||||
|
Loading…
Reference in New Issue
Block a user