Commit fcce6bd2 authored by zYne's avatar zYne

Updated transaction drivers, ORM core now uses the new Export API

parent 33fbb4f3
...@@ -34,7 +34,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun ...@@ -34,7 +34,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
/** /**
* @var $dbh the database handler * @var $dbh the database handler
*/ */
private $dbh; protected $dbh;
/** /**
* @var array $tables an array containing all the initialized Doctrine_Table objects * @var array $tables an array containing all the initialized Doctrine_Table objects
* keys representing Doctrine_Table component names and values as Doctrine_Table objects * keys representing Doctrine_Table component names and values as Doctrine_Table objects
...@@ -76,7 +76,20 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun ...@@ -76,7 +76,20 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
/** /**
* @var array $properties an array of connection properties * @var array $properties an array of connection properties
*/ */
protected $properties = array(); protected $properties = array('sql_comments' => array(array('start' => '--', 'end' => "\n", 'escape' => false),
array('start' => '/*', 'end' => '*/', 'escape' => false)
),
'identifier_quoting' => array('start' => '"',
'end' => '"',
'escape' => '"'
),
'string_quoting' => array('start' => "'",
'end' => "'",
'escape' => false,
'escape_pattern' => false
),
'wildcards' => array('%', '_')
);
/** /**
* @var array $availibleDrivers an array containing all availible drivers * @var array $availibleDrivers an array containing all availible drivers
*/ */
...@@ -254,15 +267,24 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun ...@@ -254,15 +267,24 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
} }
/** /**
* quote * quote
* quotes given input parameter
* *
* @param mixed $input * @param mixed $input parameter to be quoted
* @param string $type * @param string $type
* @return mixed * @return mixed
*/ */
public function quote($input, $type = null) { public function quote($input, $type = null) {
if($type == null) {
$type = gettype($input);
}
switch($type) { switch($type) {
case 'integer': case 'integer':
case 'enum':
case 'boolean':
return $input; return $input;
case 'array':
case 'object':
$input = serialize($input);
case 'string': case 'string':
case 'char': case 'char':
case 'varchar': case 'varchar':
...@@ -270,8 +292,6 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun ...@@ -270,8 +292,6 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
case 'gzip': case 'gzip':
case 'blob': case 'blob':
case 'clob': case 'clob':
case 'array':
case 'object':
return $this->dbh->quote($input); return $this->dbh->quote($input);
} }
} }
......
...@@ -44,7 +44,7 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { ...@@ -44,7 +44,7 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common {
*/ */
public function __construct(Doctrine_Manager $manager, $adapter) { public function __construct(Doctrine_Manager $manager, $adapter) {
$adapter->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); $adapter->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$this->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_TYPE, 'INNODB'); $this->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_TYPE, 'INNODB');
$this->supported = array( $this->supported = array(
......
...@@ -65,6 +65,14 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { ...@@ -65,6 +65,14 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common {
'pattern_escaping' => true, 'pattern_escaping' => true,
); );
$this->properties['string_quoting'] = array('start' => "'",
'end' => "'",
'escape' => "'",
'escape_pattern' => '\\');
$this->properties['identifier_quoting'] = array('start' => '"',
'end' => '"',
'escape' => '"');
parent::__construct($manager, $adapter); parent::__construct($manager, $adapter);
} }
/** /**
...@@ -92,10 +100,9 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { ...@@ -92,10 +100,9 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common {
* Returns the current id of a sequence * Returns the current id of a sequence
* *
* @param string $seq_name name of the sequence * @param string $seq_name name of the sequence
* @return mixed MDB2 Error Object or id * @return integer
* @access public
*/ */
function currId($sequence) { public function currId($sequence) {
$stmt = $this->dbh->query('SELECT last_value FROM '.$sequence); $stmt = $this->dbh->query('SELECT last_value FROM '.$sequence);
$data = $stmt->fetch(PDO::FETCH_NUM); $data = $stmt->fetch(PDO::FETCH_NUM);
return $data[0]; return $data[0];
......
...@@ -60,6 +60,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module { ...@@ -60,6 +60,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module {
case 'array': case 'array':
case 'string': case 'string':
case 'char': case 'char':
case 'gzip':
case 'varchar': case 'varchar':
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null; $length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
...@@ -93,19 +94,8 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module { ...@@ -93,19 +94,8 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module {
return 'LONGBLOB'; return 'LONGBLOB';
case 'enum': case 'enum':
case 'integer': case 'integer':
if (!empty($field['length'])) {
$length = $field['length'];
if ($length <= 2) {
return 'SMALLINT';
} elseif ($length == 3 || $length == 4) {
return 'INTEGER';
} elseif ($length > 4) {
return 'BIGINT';
}
}
return 'INTEGER';
case 'boolean': case 'boolean':
return 'BOOLEAN'; return 'INTEGER';
case 'date': case 'date':
return 'DATE'; return 'DATE';
case 'time': case 'time':
...@@ -120,7 +110,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module { ...@@ -120,7 +110,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module {
$length = !empty($field['length']) ? $field['length'] : 18; $length = !empty($field['length']) ? $field['length'] : 18;
return 'DECIMAL('.$length.','.$db->options['decimal_places'].')'; return 'DECIMAL('.$length.','.$db->options['decimal_places'].')';
} }
return ''; throw new Doctrine_DataDict_Sqlite_Exception('Unknown datatype ' . $field['type']);
} }
/** /**
* Maps a native array description of a field to Doctrine datatype and length * Maps a native array description of a field to Doctrine datatype and length
...@@ -262,13 +252,16 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module { ...@@ -262,13 +252,16 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module {
*/ */
public function getIntegerDeclaration($name, array $field) { public function getIntegerDeclaration($name, array $field) {
$default = $autoinc = ''; $default = $autoinc = '';
$type = $this->getNativeDeclaration($field);
if(isset($field['autoincrement']) && $field['autoincrement']) { if(isset($field['autoincrement']) && $field['autoincrement']) {
$autoinc = ' PRIMARY KEY AUTOINCREMENT'; $autoinc = ' PRIMARY KEY AUTOINCREMENT';
} elseif (array_key_exists('default', $field)) { $type = 'INTEGER';
} elseif(array_key_exists('default', $field)) {
if ($field['default'] === '') { if ($field['default'] === '') {
$field['default'] = empty($field['notnull']) ? null : 0; $field['default'] = empty($field['notnull']) ? null : 0;
} }
$default = ' DEFAULT '.$this->conn->quote($field['default'], $field['type']); $default = ' DEFAULT ' . $this->conn->quote($field['default'], $field['type']);
}/** }/**
elseif (empty($field['notnull'])) { elseif (empty($field['notnull'])) {
$default = ' DEFAULT NULL'; $default = ' DEFAULT NULL';
...@@ -279,7 +272,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module { ...@@ -279,7 +272,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_Connection_Module {
$unsigned = (isset($field['unsigned']) && $field['unsigned']) ? ' UNSIGNED' : ''; $unsigned = (isset($field['unsigned']) && $field['unsigned']) ? ' UNSIGNED' : '';
$name = $this->conn->quoteIdentifier($name, true); $name = $this->conn->quoteIdentifier($name, true);
return $name . ' ' . $this->getNativeDeclaration($field) . $unsigned . $default . $notnull . $autoinc; return $name . ' ' . $type . $unsigned . $default . $notnull . $autoinc;
} }
/** /**
* lists all databases * lists all databases
......
...@@ -140,6 +140,7 @@ class Doctrine_Export extends Doctrine_Connection_Module { ...@@ -140,6 +140,7 @@ class Doctrine_Export extends Doctrine_Connection_Module {
$name = $this->conn->quoteIdentifier($name, true); $name = $this->conn->quoteIdentifier($name, true);
$query = 'CREATE TABLE ' . $name . ' (' . $queryFields . ')'; $query = 'CREATE TABLE ' . $name . ' (' . $queryFields . ')';
return $this->conn->getDbh()->exec($query); return $this->conn->getDbh()->exec($query);
} }
/** /**
...@@ -235,6 +236,7 @@ class Doctrine_Export extends Doctrine_Connection_Module { ...@@ -235,6 +236,7 @@ class Doctrine_Export extends Doctrine_Connection_Module {
} }
$query .= ' ('. implode(', ', $fields) . ')'; $query .= ' ('. implode(', ', $fields) . ')';
return $this->conn->getDbh()->query($query); return $this->conn->getDbh()->query($query);
} }
...@@ -400,7 +402,7 @@ class Doctrine_Export extends Doctrine_Connection_Module { ...@@ -400,7 +402,7 @@ class Doctrine_Export extends Doctrine_Connection_Module {
$field['default'] = empty($field['notnull']) $field['default'] = empty($field['notnull'])
? null : $this->valid_default_values[$field['type']]; ? null : $this->valid_default_values[$field['type']];
if ($field['default'] === '' if ($field['default'] === ''
&& ($db->options['portability'] & Doctrine::PORTABILITY_EMPTY_TO_NULL) && ($conn->getAttribute(Doctrine::ATTR_PORTABILITY) & Doctrine::PORTABILITY_EMPTY_TO_NULL)
) { ) {
$field['default'] = ' '; $field['default'] = ' ';
} }
......
...@@ -84,6 +84,6 @@ class Doctrine_Export_Sqlite extends Doctrine_Export { ...@@ -84,6 +84,6 @@ class Doctrine_Export_Sqlite extends Doctrine_Export {
$fields[] = $fieldString; $fields[] = $fieldString;
} }
$query .= ' ('.implode(', ', $fields) . ')'; $query .= ' ('.implode(', ', $fields) . ')';
return $this->dbh->exec($query); return $this->conn->getDbh()->exec($query);
} }
} }
...@@ -139,9 +139,12 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera ...@@ -139,9 +139,12 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
* connection * connection
* a short cut for Doctrine_Manager::getInstance()->openConnection($dbh); * a short cut for Doctrine_Manager::getInstance()->openConnection($dbh);
* *
* @param PDO|Doctrine_Adapter_Interface $adapter database driver
* @param string $name name of the connection, if empty numeric key is used
* @throws Doctrine_Manager_Exception if trying to bind a connection with an existing name
* @return Doctrine_Connection * @return Doctrine_Connection
*/ */
public static function connection(PDO $dbh) { public static function connection($adapter, $name = null) {
return Doctrine_Manager::getInstance()->openConnection($dbh); return Doctrine_Manager::getInstance()->openConnection($dbh);
} }
/** /**
......
...@@ -457,7 +457,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -457,7 +457,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
public function getQueryBase() { public function getQueryBase() {
switch($this->type) { switch($this->type) {
case self::DELETE: case self::DELETE:
if($this->conn->getName() == 'mysql') if($this->connection->getName() == 'mysql')
$q = 'DELETE '.end($this->tableAliases).' FROM '; $q = 'DELETE '.end($this->tableAliases).' FROM ';
else else
$q = 'DELETE FROM '; $q = 'DELETE FROM ';
......
...@@ -247,12 +247,20 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { ...@@ -247,12 +247,20 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
$columns = array(); $columns = array();
foreach($this->columns as $name => $column) { foreach($this->columns as $name => $column) {
$definition = $column[2]; $definition = $column[2];
$definition['type'] = $column[1]; $definition['type'] = $column[0];
$definition['length'] = $column[1];
if($definition['type'] == 'enum' && isset($definition['default']))
$definition['default'] = $this->enumIndex($name, $definition['default']);
if($definition['type'] == 'boolean' && isset($definition['default']))
$definition['default'] = (int) $definition['default'];
$columns[$name] = $definition; $columns[$name] = $definition;
} }
$this->conn->export->createTable($this->options['tableName'], $columns); $this->conn->export->createTable($this->options['tableName'], $columns);
} catch(Exception $e) { } catch(Exception $e) {
} }
} }
} }
......
...@@ -200,16 +200,12 @@ class Doctrine_Transaction extends Doctrine_Connection_Module { ...@@ -200,16 +200,12 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
if($this->transactionLevel == 0) if($this->transactionLevel == 0)
return false; return false;
$this->transactionLevel--;
if ( ! is_null($savepoint)) { if ( ! is_null($savepoint)) {
$this->transactionLevel = $this->removeSavePoints($savepoint); $this->transactionLevel = $this->removeSavePoints($savepoint);
$this->releaseSavePoint($savepoint); $this->releaseSavePoint($savepoint);
} else { } else {
if($this->transactionLevel == 1) {
if($this->transactionLevel == 0) {
$this->conn->getAttribute(Doctrine::ATTR_LISTENER)->onPreTransactionCommit($this->conn); $this->conn->getAttribute(Doctrine::ATTR_LISTENER)->onPreTransactionCommit($this->conn);
...@@ -237,6 +233,9 @@ class Doctrine_Transaction extends Doctrine_Connection_Module { ...@@ -237,6 +233,9 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
$this->conn->getAttribute(Doctrine::ATTR_LISTENER)->onTransactionCommit($this->conn); $this->conn->getAttribute(Doctrine::ATTR_LISTENER)->onTransactionCommit($this->conn);
} }
} }
$this->transactionLevel--;
return true; return true;
} }
/** /**
......
...@@ -38,7 +38,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase { ...@@ -38,7 +38,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
public function testGetNativeDefinitionSupportsIntegerType() { public function testGetNativeDefinitionSupportsIntegerType() {
$a = array('type' => 'integer', 'length' => 20, 'fixed' => false); $a = array('type' => 'integer', 'length' => 20, 'fixed' => false);
$this->assertEqual($this->dataDict->getNativeDeclaration($a), 'BIGINT'); $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'INTEGER');
$a['length'] = 4; $a['length'] = 4;
...@@ -46,7 +46,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase { ...@@ -46,7 +46,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
$a['length'] = 2; $a['length'] = 2;
$this->assertEqual($this->dataDict->getNativeDeclaration($a), 'SMALLINT'); $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'INTEGER');
} }
public function testGetNativeDefinitionSupportsFloatType() { public function testGetNativeDefinitionSupportsFloatType() {
...@@ -57,7 +57,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase { ...@@ -57,7 +57,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
public function testGetNativeDefinitionSupportsBooleanType() { public function testGetNativeDefinitionSupportsBooleanType() {
$a = array('type' => 'boolean', 'fixed' => false); $a = array('type' => 'boolean', 'fixed' => false);
$this->assertEqual($this->dataDict->getNativeDeclaration($a), 'BOOLEAN'); $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'INTEGER');
} }
public function testGetNativeDefinitionSupportsDateType() { public function testGetNativeDefinitionSupportsDateType() {
$a = array('type' => 'date', 'fixed' => false); $a = array('type' => 'date', 'fixed' => false);
......
...@@ -23,6 +23,9 @@ class AdapterMock implements Doctrine_Adapter_Interface { ...@@ -23,6 +23,9 @@ class AdapterMock implements Doctrine_Adapter_Interface {
return new AdapterStatementMock; return new AdapterStatementMock;
} }
public function getAll() {
return $this->queries;
}
public function quote($input) { public function quote($input) {
return "'" . addslashes($input) . "'"; return "'" . addslashes($input) . "'";
} }
......
...@@ -14,6 +14,7 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas ...@@ -14,6 +14,7 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint'); $this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
} }
public function testRollbackSavePointExecutesSql() { public function testRollbackSavePointExecutesSql() {
$this->transaction->beginTransaction('mypoint');
$this->transaction->rollback('mypoint'); $this->transaction->rollback('mypoint');
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint'); $this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
......
...@@ -14,6 +14,7 @@ class Doctrine_Transaction_Mysql_TestCase extends Doctrine_Driver_UnitTestCase { ...@@ -14,6 +14,7 @@ class Doctrine_Transaction_Mysql_TestCase extends Doctrine_Driver_UnitTestCase {
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint'); $this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
} }
public function testRollbackSavePointExecutesSql() { public function testRollbackSavePointExecutesSql() {
$this->transaction->beginTransaction('mypoint');
$this->transaction->rollback('mypoint'); $this->transaction->rollback('mypoint');
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint'); $this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
......
...@@ -12,6 +12,7 @@ class Doctrine_Transaction_Oracle_TestCase extends Doctrine_Driver_UnitTestCase ...@@ -12,6 +12,7 @@ class Doctrine_Transaction_Oracle_TestCase extends Doctrine_Driver_UnitTestCase
$this->assertEqual($this->transaction->commit('mypoint'), true); $this->assertEqual($this->transaction->commit('mypoint'), true);
} }
public function testRollbackSavePointExecutesSql() { public function testRollbackSavePointExecutesSql() {
$this->transaction->beginTransaction('mypoint');
$this->transaction->rollback('mypoint'); $this->transaction->rollback('mypoint');
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint'); $this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
......
...@@ -14,6 +14,7 @@ class Doctrine_Transaction_Pgsql_TestCase extends Doctrine_Driver_UnitTestCase { ...@@ -14,6 +14,7 @@ class Doctrine_Transaction_Pgsql_TestCase extends Doctrine_Driver_UnitTestCase {
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint'); $this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
} }
public function testRollbackSavePointExecutesSql() { public function testRollbackSavePointExecutesSql() {
$this->transaction->beginTransaction('mypoint');
$this->transaction->rollback('mypoint'); $this->transaction->rollback('mypoint');
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint'); $this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
......
...@@ -63,19 +63,19 @@ class Doctrine_UnitTestCase extends UnitTestCase { ...@@ -63,19 +63,19 @@ class Doctrine_UnitTestCase extends UnitTestCase {
if($this->manager->count() > 0) { try {
$this->connection = $this->manager->getConnection(0); $this->connection = $this->manager->getConnection('main');
$this->connection->evictTables(); $this->connection->evictTables();
$this->dbh = $this->connection->getDBH(); $this->dbh = $this->connection->getDBH();
$this->listener = $this->manager->getAttribute(Doctrine::ATTR_LISTENER); $this->listener = $this->manager->getAttribute(Doctrine::ATTR_LISTENER);
$this->manager->setAttribute(Doctrine::ATTR_LISTENER, $this->listener); $this->manager->setAttribute(Doctrine::ATTR_LISTENER, $this->listener);
} else { } catch(Doctrine_Manager_Exception $e) {
//$this->dbh = Doctrine_Db::getConnection(); //$this->dbh = Doctrine_Db::getConnection();
$this->dbh = Doctrine_Db::getConnection("sqlite::memory:"); $this->dbh = Doctrine_Db::getConnection("sqlite::memory:");
//$this->dbh = new PDO("sqlite::memory:"); //$this->dbh = new PDO("sqlite::memory:");
$this->connection = $this->manager->openConnection($this->dbh); $this->connection = $this->manager->openConnection($this->dbh, 'main');
$this->listener = new Doctrine_EventListener_Debugger(); $this->listener = new Doctrine_EventListener_Debugger();
$this->manager->setAttribute(Doctrine::ATTR_LISTENER, $this->listener); $this->manager->setAttribute(Doctrine::ATTR_LISTENER, $this->listener);
...@@ -87,6 +87,7 @@ class Doctrine_UnitTestCase extends UnitTestCase { ...@@ -87,6 +87,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
$this->prepareData(); $this->prepareData();
$this->valueHolder = new Doctrine_ValueHolder($this->connection->getTable('User')); $this->valueHolder = new Doctrine_ValueHolder($this->connection->getTable('User'));
} }
public function prepareTables() { public function prepareTables() {
foreach($this->tables as $name) { foreach($this->tables as $name) {
......
...@@ -104,6 +104,7 @@ require_once('ExportMysqlTestCase.php'); ...@@ -104,6 +104,7 @@ require_once('ExportMysqlTestCase.php');
require_once('ExportFirebirdTestCase.php'); require_once('ExportFirebirdTestCase.php');
require_once('ExportPgsqlTestCase.php'); require_once('ExportPgsqlTestCase.php');
require_once('ExportOracleTestCase.php'); require_once('ExportOracleTestCase.php');
require_once('ExportSqliteTestCase.php');
require_once('TransactionTestCase.php'); require_once('TransactionTestCase.php');
require_once('TransactionMysqlTestCase.php'); require_once('TransactionMysqlTestCase.php');
...@@ -122,7 +123,16 @@ print '<pre>'; ...@@ -122,7 +123,16 @@ print '<pre>';
$test = new GroupTest('Doctrine Framework Unit Tests'); $test = new GroupTest('Doctrine Framework Unit Tests');
/** /**
$test->addTestCase(new Doctrine_Export_Sqlite_TestCase());
foreach($drivers as $driver) {
$class = 'Doctrine_DataDict_' . $driver . '_TestCase';
$test->addTestCase(new $class());
}
$test->addTestCase(new Doctrine_Connection_Mysql_TestCase()); $test->addTestCase(new Doctrine_Connection_Mysql_TestCase());
$test->addTestCase(new Doctrine_Export_Mysql_TestCase()); $test->addTestCase(new Doctrine_Export_Mysql_TestCase());
...@@ -133,16 +143,9 @@ $test->addTestCase(new Doctrine_Export_Pgsql_TestCase()); ...@@ -133,16 +143,9 @@ $test->addTestCase(new Doctrine_Export_Pgsql_TestCase());
$test->addTestCase(new Doctrine_Export_Firebird_TestCase()); $test->addTestCase(new Doctrine_Export_Firebird_TestCase());
foreach($drivers as $driver) {
$class = 'Doctrine_DataDict_' . $driver . '_TestCase';
$test->addTestCase(new $class());
}
$test->addTestCase(new Doctrine_Configurable_TestCase()); $test->addTestCase(new Doctrine_Configurable_TestCase());
*/
...@@ -159,9 +162,16 @@ $test->addTestCase(new Doctrine_Transaction_Firebird_TestCase()); ...@@ -159,9 +162,16 @@ $test->addTestCase(new Doctrine_Transaction_Firebird_TestCase());
$test->addTestCase(new Doctrine_Transaction_Sqlite_TestCase()); $test->addTestCase(new Doctrine_Transaction_Sqlite_TestCase());
$test->addTestCase(new Doctrine_Transaction_Mssql_TestCase()); */ $test->addTestCase(new Doctrine_Transaction_Mssql_TestCase());
//$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase()); $test->addTestCase(new Doctrine_BooleanTestCase());
$test->addTestCase(new Doctrine_TableTestCase());
$test->addTestCase(new Doctrine_ValidatorTestCase());
$test->addTestCase(new Doctrine_UnitOfWork_TestCase()); $test->addTestCase(new Doctrine_UnitOfWork_TestCase());
...@@ -185,7 +195,6 @@ $test->addTestCase(new Doctrine_Record_State_TestCase()); ...@@ -185,7 +195,6 @@ $test->addTestCase(new Doctrine_Record_State_TestCase());
$test->addTestCase(new Doctrine_SchemaTestCase()); $test->addTestCase(new Doctrine_SchemaTestCase());
$test->addTestCase(new Doctrine_ValidatorTestCase());
$test->addTestCase(new Doctrine_EventListenerTestCase()); $test->addTestCase(new Doctrine_EventListenerTestCase());
...@@ -193,8 +202,6 @@ $test->addTestCase(new Doctrine_Connection_Transaction_TestCase()); ...@@ -193,8 +202,6 @@ $test->addTestCase(new Doctrine_Connection_Transaction_TestCase());
$test->addTestCase(new Doctrine_AccessTestCase()); $test->addTestCase(new Doctrine_AccessTestCase());
$test->addTestCase(new Doctrine_TableTestCase());
$test->addTestCase(new Doctrine_ManagerTestCase()); $test->addTestCase(new Doctrine_ManagerTestCase());
$test->addTestCase(new Doctrine_BatchIteratorTestCase()); $test->addTestCase(new Doctrine_BatchIteratorTestCase());
...@@ -224,7 +231,6 @@ $test->addTestCase(new Doctrine_RelationAccessTestCase()); ...@@ -224,7 +231,6 @@ $test->addTestCase(new Doctrine_RelationAccessTestCase());
$test->addTestCase(new Doctrine_CustomResultSetOrderTestCase()); $test->addTestCase(new Doctrine_CustomResultSetOrderTestCase());
$test->addTestCase(new Doctrine_BooleanTestCase());
//$test->addTestCase(new Doctrine_Record_Filter_TestCase()); //$test->addTestCase(new Doctrine_Record_Filter_TestCase());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment