From 5582f07b53a50d276266ea64a165a9e1ef6b8af3 Mon Sep 17 00:00:00 2001 From: jwage Date: Thu, 19 Feb 2009 07:00:54 +0000 Subject: [PATCH] [2.0] Intermediate refactoring for new exception handling --- lib/Doctrine/Common/DoctrineException.php | 26 ++++++++- lib/Doctrine/DBAL/Connection.php | 4 +- .../DBAL/Exceptions/DBALException.php | 34 ----------- .../DBAL/Platforms/AbstractPlatform.php | 58 +++++++++---------- .../DBAL/Platforms/FirebirdPlatform.php | 6 +- .../DBAL/Platforms/InformixPlatform.php | 4 +- lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php | 8 +-- lib/Doctrine/DBAL/Platforms/MySqlPlatform.php | 24 ++++---- .../DBAL/Platforms/OraclePlatform.php | 10 ++-- .../DBAL/Platforms/PostgreSqlPlatform.php | 16 ++--- .../DBAL/Platforms/SqlitePlatform.php | 10 ++-- .../DBAL/Schema/FirebirdSchemaManager.php | 19 +++--- .../DBAL/Schema/MsSqlSchemaManager.php | 2 +- .../DBAL/Schema/MySqlSchemaManager.php | 4 +- .../DBAL/Schema/OracleSchemaManager.php | 8 +-- .../DBAL/Schema/SqliteSchemaManager.php | 14 ++--- lib/Doctrine/ORM/AbstractQuery.php | 4 +- lib/Doctrine/ORM/Cache/DbCache.php | 4 +- lib/Doctrine/ORM/Cache/MemcacheCache.php | 2 +- lib/Doctrine/ORM/Cache/XcacheCache.php | 2 +- lib/Doctrine/ORM/EntityRepository.php | 6 +- lib/Doctrine/ORM/Mapping/ClassMetadata.php | 2 +- .../Persisters/JoinedSubclassPersister.php | 4 +- .../Persisters/StandardEntityPersister.php | 2 +- lib/Doctrine/ORM/Query/AbstractResult.php | 2 +- lib/Doctrine/ORM/Query/ParserResult.php | 2 +- lib/Doctrine/ORM/Query/ParserRule.php | 2 +- tests/Doctrine/Tests/Common/AllTests.php | 5 +- 28 files changed, 135 insertions(+), 149 deletions(-) delete mode 100644 lib/Doctrine/DBAL/Exceptions/DBALException.php diff --git a/lib/Doctrine/Common/DoctrineException.php b/lib/Doctrine/Common/DoctrineException.php index bb9c94560..8252b2a9a 100644 --- a/lib/Doctrine/Common/DoctrineException.php +++ b/lib/Doctrine/Common/DoctrineException.php @@ -5,7 +5,8 @@ namespace Doctrine\Common; class DoctrineException extends \Exception { private $_innerException; - + private static $_messages = array(); + public function __construct($message = "", Exception $innerException = null) { parent::__construct($message); @@ -21,5 +22,26 @@ class DoctrineException extends \Exception { return new self("The method '$method' is not implemented in class '$class'."); } -} + public static function __callStatic($method, $arguments) + { + $end = end($arguments); + if ($end instanceof Exception) { + $this->_innerException = $end; + unset($arguments[count($arguments) - 1]); + } + + if (isset(self::$_messages[$method])) { + $message = sprintf(self::$_messages[$method], $arguments); + } else { + $message = strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $method)); + $message = ucfirst(str_replace('_', ' ', $message)); + $args = array(); + foreach ($arguments as $argument) { + $args[] = var_export($argument, true); + } + $message .= ' (' . implode(', ', $args) . ')'; + } + return new self($message); + } +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index c0a71f650..b8b6f2bbd 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -688,7 +688,7 @@ class Connection public function commit() { if ($this->_transactionNestingLevel == 0) { - throw new DoctrineException("Commit failed. There is no active transaction."); + throw ConnectionException::commitFailedNoActiveTransaction(); } $this->connect(); @@ -717,7 +717,7 @@ class Connection public function rollback() { if ($this->_transactionNestingLevel == 0) { - throw new Doctrine_Exception("Rollback failed. There is no active transaction."); + throw ConnectionException::rollbackFailedNoActiveTransaction(); } $this->connect(); diff --git a/lib/Doctrine/DBAL/Exceptions/DBALException.php b/lib/Doctrine/DBAL/Exceptions/DBALException.php deleted file mode 100644 index bf1fc3a60..000000000 --- a/lib/Doctrine/DBAL/Exceptions/DBALException.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class DBALException extends DoctrineException -{ - public static function invalidPDOInstance() - { - return new self("Invalid PDO instance provided on connection creation."); - } - - public static function driverRequired() - { - return new self("Please provide a driver or a driverClass to be able to start a Connection."); - } - - public static function unknownDriver($driver) - { - return new self("Unknown Connection driver '$driver'."); - } -} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index e53c57580..c11f59846 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -130,7 +130,7 @@ abstract class AbstractPlatform */ public function getRegexpExpression() { - throw new Doctrine_Expression_Exception('Regular expression operator is not supported by this database driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('Regular expression operator is not supported by this database driver.'); } /** @@ -350,7 +350,7 @@ abstract class AbstractPlatform */ public function getSoundexExpression($value) { - throw new Doctrine_Expression_Exception('SQL soundex function not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('SQL soundex function not supported by this driver.'); } /** @@ -700,7 +700,7 @@ abstract class AbstractPlatform $column = $this->getIdentifier($column); if (count($values) == 0) { - throw new Doctrine_Expression_Exception('Values array for IN operator should not be empty.'); + throw \Doctrine\Common\DoctrineException::updateMe('Values array for IN operator should not be empty.'); } return $column . ' IN (' . implode(', ', $values) . ')'; } @@ -783,7 +783,7 @@ abstract class AbstractPlatform */ public function getGuidExpression() { - throw new Doctrine_Expression_Exception('method not implemented'); + throw \Doctrine\Common\DoctrineException::updateMe('method not implemented'); } /** @@ -846,7 +846,7 @@ abstract class AbstractPlatform */ public function getListDatabasesSql() { - throw new Doctrine_Export_Exception('List databases not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List databases not supported by this driver.'); } /** @@ -856,7 +856,7 @@ abstract class AbstractPlatform */ public function getListFunctionsSql() { - throw new Doctrine_Export_Exception('List functions not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List functions not supported by this driver.'); } /** @@ -866,7 +866,7 @@ abstract class AbstractPlatform */ public function getListTriggersSql() { - throw new Doctrine_Export_Exception('List triggers not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List triggers not supported by this driver.'); } /** @@ -876,7 +876,7 @@ abstract class AbstractPlatform */ public function getListSequencesSql() { - throw new Doctrine_Export_Exception('List sequences not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List sequences not supported by this driver.'); } /** @@ -886,7 +886,7 @@ abstract class AbstractPlatform */ public function getListTableConstraintsSql() { - throw new Doctrine_Export_Exception('List table constraints not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List table constraints not supported by this driver.'); } /** @@ -896,7 +896,7 @@ abstract class AbstractPlatform */ public function getListTableColumnsSql() { - throw new Doctrine_Export_Exception('List table columns not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List table columns not supported by this driver.'); } /** @@ -906,7 +906,7 @@ abstract class AbstractPlatform */ public function getListTablesSql() { - throw new Doctrine_Export_Exception('List tables not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List tables not supported by this driver.'); } /** @@ -916,7 +916,7 @@ abstract class AbstractPlatform */ public function getListUsersSql() { - throw new Doctrine_Export_Exception('List users not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List users not supported by this driver.'); } /** @@ -926,7 +926,7 @@ abstract class AbstractPlatform */ public function getListViewsSql() { - throw new Doctrine_Export_Exception('List views not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('List views not supported by this driver.'); } /** @@ -966,7 +966,7 @@ abstract class AbstractPlatform */ public function getDropSequenceSql() { - throw new Doctrine_Export_Exception('Drop sequence not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('Drop sequence not supported by this driver.'); } /** @@ -974,7 +974,7 @@ abstract class AbstractPlatform */ public function getSequenceNextValSql($sequenceName) { - throw new Doctrine_Export_Exception('Sequences not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('Sequences not supported by this driver.'); } /** @@ -984,7 +984,7 @@ abstract class AbstractPlatform */ public function getCreateDatabaseSql($database) { - throw new Doctrine_Export_Exception('Create database not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('Create database not supported by this driver.'); } /** @@ -995,10 +995,10 @@ abstract class AbstractPlatform public function getCreateTableSql($table, array $columns, array $options = array()) { if ( ! $table) { - throw new Doctrine_Export_Exception('no valid table name specified'); + throw \Doctrine\Common\DoctrineException::updateMe('no valid table name specified'); } if (empty($columns)) { - throw new Doctrine_Export_Exception('no fields specified for table ' . $name); + throw \Doctrine\Common\DoctrineException::updateMe('no fields specified for table ' . $name); } $queryFields = $this->getFieldDeclarationListSql($columns); @@ -1042,7 +1042,7 @@ abstract class AbstractPlatform */ public function getCreateSequenceSql($sequenceName, $start = 1, array $options) { - throw new Doctrine_Export_Exception('Create sequence not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('Create sequence not supported by this driver.'); } /** @@ -1103,7 +1103,7 @@ abstract class AbstractPlatform $type = strtoupper($definition['type']) . ' '; break; default: - throw new Doctrine_Export_Exception('Unknown index type ' . $definition['type']); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown index type ' . $definition['type']); } } @@ -1199,7 +1199,7 @@ abstract class AbstractPlatform */ public function getAlterTableSql($name, array $changes, $check = false) { - throw new Doctrine_Export_Exception('Alter table not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('Alter table not supported by this driver.'); } /** @@ -1407,12 +1407,12 @@ abstract class AbstractPlatform if (strtolower($definition['type']) == 'unique') { $type = strtoupper($definition['type']) . ' '; } else { - throw new Doctrine_Export_Exception('Unknown index type ' . $definition['type']); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown index type ' . $definition['type']); } } if ( ! isset($definition['fields']) || ! is_array($definition['fields'])) { - throw new Doctrine_Export_Exception('No index columns given.'); + throw \Doctrine\Common\DoctrineException::updateMe('No index columns given.'); } $query = $type . 'INDEX ' . $name; @@ -1468,7 +1468,7 @@ abstract class AbstractPlatform */ public function getShowDatabasesSql() { - throw new Doctrine_Export_Exception('Show databases not supported by this driver.'); + throw \Doctrine\Common\DoctrineException::updateMe('Show databases not supported by this driver.'); } /** @@ -1561,7 +1561,7 @@ abstract class AbstractPlatform return $upper; break; default: - throw new Doctrine_Export_Exception('Unknown foreign key referential action \'' . $upper . '\' given.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown foreign key referential action \'' . $upper . '\' given.'); } } @@ -1581,13 +1581,13 @@ abstract class AbstractPlatform $sql .= 'FOREIGN KEY ('; if ( ! isset($definition['local'])) { - throw new Doctrine_Export_Exception('Local reference field missing from definition.'); + throw \Doctrine\Common\DoctrineException::updateMe('Local reference field missing from definition.'); } if ( ! isset($definition['foreign'])) { - throw new Doctrine_Export_Exception('Foreign reference field missing from definition.'); + throw \Doctrine\Common\DoctrineException::updateMe('Foreign reference field missing from definition.'); } if ( ! isset($definition['foreignTable'])) { - throw new Doctrine_Export_Exception('Foreign reference table missing from definition.'); + throw \Doctrine\Common\DoctrineException::updateMe('Foreign reference table missing from definition.'); } if ( ! is_array($definition['local'])) { @@ -1662,7 +1662,7 @@ abstract class AbstractPlatform */ public function getMatchPatternExpression($pattern, $operator = null, $field = null) { - throw new Doctrine_Expression_Exception("Method not implemented."); + throw \Doctrine\Common\DoctrineException::updateMe("Method not implemented."); } /** diff --git a/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php b/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php index f040c456d..71326d0fa 100644 --- a/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php @@ -86,7 +86,7 @@ class FirebirdPlatform extends AbstractPlatform public function getNativeDeclaration($field) { if ( ! isset($field['type'])) { - throw new Doctrine_DataDict_Exception('Missing column type.'); + throw \Doctrine\Common\DoctrineException::updateMe('Missing column type.'); } switch ($field['type']) { case 'varchar': @@ -126,7 +126,7 @@ class FirebirdPlatform extends AbstractPlatform return 'DECIMAL('.$length.','.$scale.')'; } - throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } /** @@ -211,7 +211,7 @@ class FirebirdPlatform extends AbstractPlatform $length = null; break; default: - throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$dbType); + throw \Doctrine\Common\DoctrineException::updateMe('unknown database attribute type: '.$dbType); } return array('type' => $type, diff --git a/lib/Doctrine/DBAL/Platforms/InformixPlatform.php b/lib/Doctrine/DBAL/Platforms/InformixPlatform.php index a88d606e6..6aed01eb2 100644 --- a/lib/Doctrine/DBAL/Platforms/InformixPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/InformixPlatform.php @@ -42,7 +42,7 @@ class InformixPlatform extends AbstractPlatform public function getNativeDeclaration($field) { if ( ! isset($field['type'])) { - throw new Doctrine_DataDict_Exception('Missing column type.'); + throw \Doctrine\Common\DoctrineException::updateMe('Missing column type.'); } switch ($field['type']) { case 'char': @@ -90,7 +90,7 @@ class InformixPlatform extends AbstractPlatform case 'decimal': return 'DECIMAL'; } - throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } } diff --git a/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php index e1309c1c6..acb97bdc5 100644 --- a/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php @@ -30,7 +30,7 @@ class MsSqlPlatform extends AbstractPlatform $offset = intval($offset); if ($offset < 0) { - throw new Doctrine_Connection_Exception("LIMIT argument offset=$offset is not valid"); + throw \Doctrine\Common\DoctrineException::updateMe("LIMIT argument offset=$offset is not valid"); } $orderby = stristr($query, 'ORDER BY'); @@ -147,7 +147,7 @@ class MsSqlPlatform extends AbstractPlatform public function getNativeDeclaration($field) { if ( ! isset($field['type'])) { - throw new Doctrine_DataDict_Exception('Missing column type.'); + throw \Doctrine\Common\DoctrineException::updateMe('Missing column type.'); } switch ($field['type']) { case 'array': @@ -200,7 +200,7 @@ class MsSqlPlatform extends AbstractPlatform return 'DECIMAL('.$length.','.$scale.')'; } - throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } /** @@ -272,7 +272,7 @@ class MsSqlPlatform extends AbstractPlatform $length = null; break; default: - throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$db_type); + throw \Doctrine\Common\DoctrineException::updateMe('unknown database attribute type: '.$db_type); } return array('type' => $type, diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index abec3c083..74bbef1d9 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -185,7 +185,7 @@ class MySqlPlatform extends AbstractPlatform $match = $field.'LIKE BINARY '; break; default: - throw new Doctrine_Expression_Mysql_Exception('not a supported operator type:'. $operator); + throw \Doctrine\Common\DoctrineException::updateMe('not a supported operator type:'. $operator); } } $match.= "'"; @@ -297,7 +297,7 @@ class MySqlPlatform extends AbstractPlatform public function getNativeDeclaration(array $field) { if ( ! isset($field['type'])) { - throw new Doctrine_DataDict_Exception('Missing column type.'); + throw \Doctrine\Common\DoctrineException::updateMe('Missing column type.'); } switch ($field['type']) { @@ -367,7 +367,7 @@ class MySqlPlatform extends AbstractPlatform $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES); return 'DECIMAL('.$length.','.$scale.')'; } - throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } /** @@ -520,7 +520,7 @@ class MySqlPlatform extends AbstractPlatform $length = null; break; default: - throw new Doctrine_DataDict_Exception('unknown database attribute type: ' . $dbType); + throw \Doctrine\Common\DoctrineException::updateMe('unknown database attribute type: ' . $dbType); } $length = ((int) $length == 0) ? null : (int) $length; @@ -678,10 +678,10 @@ class MySqlPlatform extends AbstractPlatform public function getCreateTableSql($name, array $fields, array $options = array()) { if ( ! $name) { - throw new Doctrine_Export_Exception('no valid table name specified'); + throw \Doctrine\Common\DoctrineException::updateMe('no valid table name specified'); } if (empty($fields)) { - throw new Doctrine_Export_Exception('no fields specified for table "'.$name.'"'); + throw \Doctrine\Common\DoctrineException::updateMe('no fields specified for table "'.$name.'"'); } $queryFields = $this->getFieldDeclarationListSql($fields); @@ -866,7 +866,7 @@ class MySqlPlatform extends AbstractPlatform public function getAlterTableSql($name, array $changes, $check = false) { if ( ! $name) { - throw new Doctrine_Export_Exception('no valid table name specified'); + throw \Doctrine\Common\DoctrineException::updateMe('no valid table name specified'); } foreach ($changes as $changeName => $change) { switch ($changeName) { @@ -877,7 +877,7 @@ class MySqlPlatform extends AbstractPlatform case 'name': break; default: - throw new Doctrine_Export_Exception('change type "' . $changeName . '" not yet supported'); + throw \Doctrine\Common\DoctrineException::updateMe('change type "' . $changeName . '" not yet supported'); } } @@ -1003,7 +1003,7 @@ class MySqlPlatform extends AbstractPlatform $type = strtoupper($definition['type']) . ' '; break; default: - throw new Doctrine_Export_Exception('Unknown index type ' . $definition['type']); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown index type ' . $definition['type']); } } $query = 'CREATE ' . $type . 'INDEX ' . $name . ' ON ' . $table; @@ -1139,12 +1139,12 @@ class MySqlPlatform extends AbstractPlatform $type = strtoupper($definition['type']) . ' '; break; default: - throw new Doctrine_Export_Exception('Unknown index type ' . $definition['type']); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown index type ' . $definition['type']); } } if ( ! isset($definition['fields'])) { - throw new Doctrine_Export_Exception('No index columns given.'); + throw \Doctrine\Common\DoctrineException::updateMe('No index columns given.'); } if ( ! is_array($definition['fields'])) { $definition['fields'] = array($definition['fields']); @@ -1185,7 +1185,7 @@ class MySqlPlatform extends AbstractPlatform $fieldString .= ' ' . $sort; break; default: - throw new Doctrine_Export_Exception('Unknown index sorting option given.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown index sorting option given.'); } } } else { diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index 44da52f02..6837ae140 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -95,7 +95,7 @@ class OraclePlatform extends AbstractPlatform // NOTE: no composite key support $columnNames = $rootClass->getIdentifierColumnNames(); if (count($columnNames) > 1) { - throw new Doctrine_Connection_Exception("Composite keys in LIMIT queries are " + throw \Doctrine\Common\DoctrineException::updateMe("Composite keys in LIMIT queries are " . "currently not supported."); } $column = $columnNames[0]; @@ -191,7 +191,7 @@ class OraclePlatform extends AbstractPlatform public function getNativeDeclaration(array $field) { if ( ! isset($field['type'])) { - throw new Doctrine_DataDict_Exception('Missing column type.'); + throw \Doctrine\Common\DoctrineException::updateMe('Missing column type.'); } switch ($field['type']) { case 'string': @@ -231,7 +231,7 @@ class OraclePlatform extends AbstractPlatform return 'NUMBER(*,'.$scale.')'; default: } - throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } /** @@ -245,7 +245,7 @@ class OraclePlatform extends AbstractPlatform public function getPortableDeclaration(array $field) { if ( ! isset($field['data_type'])) { - throw new Doctrine_DataDict_Exception('Native oracle definition must have a data_type key specified'); + throw \Doctrine\Common\DoctrineException::updateMe('Native oracle definition must have a data_type key specified'); } $dbType = strtolower($field['data_type']); @@ -325,7 +325,7 @@ class OraclePlatform extends AbstractPlatform case 'rowid': case 'urowid': default: - throw new Doctrine_DataDict_Exception('unknown database attribute type: ' . $dbType); + throw \Doctrine\Common\DoctrineException::updateMe('unknown database attribute type: ' . $dbType); } return array('type' => $type, diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index 7420bf265..3fcac3cc7 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -101,7 +101,7 @@ class PostgreSqlPlatform extends AbstractPlatform public function getNativeDeclaration(array $field) { if ( ! isset($field['type'])) { - throw new Doctrine_DataDict_Exception('Missing column type.'); + throw \Doctrine\Common\DoctrineException::updateMe('Missing column type.'); } switch ($field['type']) { case 'char': @@ -161,7 +161,7 @@ class PostgreSqlPlatform extends AbstractPlatform $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES); return 'NUMERIC('.$length.','.$scale.')'; } - throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } /** @@ -293,7 +293,7 @@ class PostgreSqlPlatform extends AbstractPlatform $length = null; break; default: - throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$dbType); + throw \Doctrine\Common\DoctrineException::updateMe('unknown database attribute type: '.$dbType); } return array('type' => $type, @@ -461,7 +461,7 @@ class PostgreSqlPlatform extends AbstractPlatform $match = $field.'LIKE '; break; default: - throw new Doctrine_Expression_Pgsql_Exception('not a supported operator type:'. $operator); + throw \Doctrine\Common\DoctrineException::updateMe('not a supported operator type:'. $operator); } } $match.= "'"; @@ -766,7 +766,7 @@ class PostgreSqlPlatform extends AbstractPlatform case 'rename': break; default: - throw new Doctrine_Export_Exception('change type "' . $changeName . '\" not yet supported'); + throw \Doctrine\Common\DoctrineException::updateMe('change type "' . $changeName . '\" not yet supported'); } } @@ -798,7 +798,7 @@ class PostgreSqlPlatform extends AbstractPlatform $serverInfo = $this->getServerVersion(); if (is_array($serverInfo) && $serverInfo['major'] < 8) { - throw new Doctrine_Export_Exception('changing column type for "'.$field['type'].'\" requires PostgreSQL 8.0 or above'); + throw \Doctrine\Common\DoctrineException::updateMe('changing column type for "'.$field['type'].'\" requires PostgreSQL 8.0 or above'); } $query = 'ALTER ' . $fieldName . ' TYPE ' . $this->getTypeDeclarationSql($field['definition']); $sql[] = 'ALTER TABLE ' . $name . ' ' . $query; @@ -875,10 +875,10 @@ class PostgreSqlPlatform extends AbstractPlatform public function getCreateTableSql($name, array $fields, array $options = array()) { if ( ! $name) { - throw new Doctrine_Export_Exception('no valid table name specified'); + throw \Doctrine\Common\DoctrineException::updateMe('no valid table name specified'); } if (empty($fields)) { - throw new Doctrine_Export_Exception('no fields specified for table ' . $name); + throw \Doctrine\Common\DoctrineException::updateMe('no fields specified for table ' . $name); } $queryFields = $this->getFieldDeclarationListSql($fields); diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index 2b7565e9d..43131e44c 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -195,7 +195,7 @@ class SqlitePlatform extends AbstractPlatform public function getNativeDeclaration(array $field) { if ( ! isset($field['type'])) { - throw new Doctrine_DataDict_Exception('Missing column type.'); + throw \Doctrine\Common\DoctrineException::updateMe('Missing column type.'); } switch ($field['type']) { case 'text': @@ -255,7 +255,7 @@ class SqlitePlatform extends AbstractPlatform $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES); return 'DECIMAL('.$length.','.$scale.')'; } - throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } /** @@ -372,7 +372,7 @@ class SqlitePlatform extends AbstractPlatform $length = null; break; default: - throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$dbType); + throw \Doctrine\Common\DoctrineException::updateMe('unknown database attribute type: '.$dbType); } return array('type' => $type, @@ -488,11 +488,11 @@ class SqlitePlatform extends AbstractPlatform public function getCreateTableSql($name, array $fields, array $options = array()) { if ( ! $name) { - throw new Doctrine_Exception('no valid table name specified'); + throw ConnectionException::invalidTableName($name); } if (empty($fields)) { - throw new Doctrine_Exception('no fields specified for table '.$name); + throw ConnectionException::noFieldsSpecifiedForTable($name); } $queryFields = $this->getFieldDeclarationListSql($fields); diff --git a/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php b/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php index 149b224b1..db721c27e 100644 --- a/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php @@ -135,7 +135,7 @@ class FirebirdSchemaManager extends AbstractSchemaManager */ public function createDatabase($name) { - throw new Doctrine_Export_Exception( + throw \Doctrine\Common\DoctrineException::updateMe( 'PHP Interbase API does not support direct queries. You have to ' . 'create the db manually by using isql command or a similar program'); } @@ -148,7 +148,7 @@ class FirebirdSchemaManager extends AbstractSchemaManager */ public function dropDatabase($name) { - throw new Doctrine_Export_Exception( + throw \Doctrine\Common\DoctrineException::updateMe( 'PHP Interbase API does not support direct queries. You have ' . 'to drop the db manually by using isql command or a similar program'); } @@ -275,20 +275,17 @@ class FirebirdSchemaManager extends AbstractSchemaManager foreach ($changes as $change_name => $change) { switch ($change_name) { case 'notnull': - throw new Doctrine_DataDict_Exception('it is not supported changes to field not null constraint'); + throw \Doctrine\Common\DoctrineException::updateMe('it is not supported changes to field not null constraint'); case 'default': - throw new Doctrine_DataDict_Exception('it is not supported changes to field default value'); + throw \Doctrine\Common\DoctrineException::updateMe('it is not supported changes to field default value'); case 'length': - /* - return throw new Doctrine_DataDict_Firebird_Exception('it is not supported changes to field default length'); - */ case 'unsigned': case 'type': case 'declaration': case 'definition': break; default: - throw new Doctrine_DataDict_Exception('it is not supported change of type' . $change_name); + throw \Doctrine\Common\DoctrineException::updateMe('it is not supported change of type' . $change_name); } } return true; @@ -413,7 +410,7 @@ class FirebirdSchemaManager extends AbstractSchemaManager } break; default: - throw new Doctrine_DataDict_Exception('change type ' . $changeName . ' not yet supported'); + throw \Doctrine\Common\DoctrineException::updateMe('change type ' . $changeName . ' not yet supported'); } } if ($check) { @@ -621,10 +618,10 @@ class FirebirdSchemaManager extends AbstractSchemaManager try { $this->dropSequence($seqName); } catch(Doctrine_Connection_Exception $e) { - throw new Doctrine_Export_Exception('Could not drop inconsistent sequence table'); + throw \Doctrine\Common\DoctrineException::updateMe('Could not drop inconsistent sequence table'); } } - throw new Doctrine_Export_Exception('could not create sequence table'); + throw \Doctrine\Common\DoctrineException::updateMe('could not create sequence table'); } /** diff --git a/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php index 158cb1ce7..48ec295e8 100644 --- a/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php @@ -172,7 +172,7 @@ class MsSqlSchemaManager extends AbstractSchemaManager case 'rename': case 'change': default: - throw new Doctrine_Export_Exception('alterTable: change type "' . $changeName . '" not yet supported'); + throw \Doctrine\Common\DoctrineException::updateMe('alterTable: change type "' . $changeName . '" not yet supported'); } } diff --git a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php index 2932b2eec..49028b5a2 100644 --- a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php @@ -280,7 +280,7 @@ class MySqlSchemaManager extends AbstractSchemaManager $res = $this->_conn->exec($query); } catch(Doctrine_Connection_Exception $e) { - throw new Doctrine_Export_Exception('could not create sequence table'); + throw \Doctrine\Common\DoctrineException::updateMe('could not create sequence table'); } if ($start == 1) { @@ -296,7 +296,7 @@ class MySqlSchemaManager extends AbstractSchemaManager try { $res = $this->_conn->exec('DROP TABLE ' . $sequenceName); } catch(Doctrine_Connection_Exception $e) { - throw new Doctrine_Export_Exception('could not drop inconsistent sequence table'); + throw \Doctrine\Common\DoctrineException::updateMe('could not drop inconsistent sequence table'); } return $res; diff --git a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php index 419fea413..c9f9f1567 100644 --- a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php @@ -43,7 +43,7 @@ class OracleSchemaManager extends AbstractSchemaManager public function createDatabase($name) { if ( ! $this->conn->getAttribute(Doctrine::ATTR_EMULATE_DATABASE)) - throw new Doctrine_Export_Exception('database creation is only supported if the "emulate_database" attribute is enabled'); + throw \Doctrine\Common\DoctrineException::updateMe('database creation is only supported if the "emulate_database" attribute is enabled'); $username = sprintf($this->conn->getAttribute(Doctrine::ATTR_DB_NAME_FORMAT), $name); $password = $this->conn->dsn['password'] ? $this->conn->dsn['password'] : $name; @@ -75,7 +75,7 @@ class OracleSchemaManager extends AbstractSchemaManager public function dropDatabase($name) { if ( ! $this->conn->getAttribute(Doctrine::ATTR_EMULATE_DATABASE)) - throw new Doctrine_Export_Exception('database dropping is only supported if the + throw \Doctrine\Common\DoctrineException::updateMe('database dropping is only supported if the "emulate_database" option is enabled'); $username = sprintf($this->conn->getAttribute(Doctrine::ATTR_DB_NAME_FORMAT), $name); @@ -415,7 +415,7 @@ END; case 'rename': break; default: - throw new Doctrine_Export_Exception('change type "' . $changeName . '" not yet supported'); + throw \Doctrine\Common\DoctrineException::updateMe('change type "' . $changeName . '" not yet supported'); } } @@ -506,7 +506,7 @@ END; public function listDatabases() { if ( ! $this->_conn->getAttribute(Doctrine::ATTR_EMULATE_DATABASE)) { - throw new Doctrine_Import_Exception('database listing is only supported if the "emulate_database" option is enabled'); + throw \Doctrine\Common\DoctrineException::updateMe('database listing is only supported if the "emulate_database" option is enabled'); } /** if ($this->_conn->options['database_name_prefix']) { diff --git a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index 04f221d1f..be50efda1 100644 --- a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -267,13 +267,13 @@ class SqliteSchemaManager extends AbstractSchemaManager public function dropDatabase($databaseFile) { if ( ! @file_exists($databaseFile)) { - throw new Doctrine_Export_Exception('database does not exist'); + throw \Doctrine\Common\DoctrineException::updateMe('database does not exist'); } $result = @unlink($databaseFile); if ( ! $result) { - throw new Doctrine_Export_Exception('could not remove the database file'); + throw \Doctrine\Common\DoctrineException::updateMe('could not remove the database file'); } } @@ -355,7 +355,7 @@ class SqliteSchemaManager extends AbstractSchemaManager $fieldString .= ' ' . $sort; break; default: - throw new Doctrine_Export_Exception('Unknown index sorting option given.'); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown index sorting option given.'); } } } else { @@ -434,10 +434,10 @@ class SqliteSchemaManager extends AbstractSchemaManager try { $result = $db->exec('DROP TABLE ' . $sequenceName); } catch(Doctrine_Connection_Exception $e) { - throw new Doctrine_Export_Exception('could not drop inconsistent sequence table'); + throw \Doctrine\Common\DoctrineException::updateMe('could not drop inconsistent sequence table'); } } - throw new Doctrine_Export_Exception('could not create sequence table'); + throw \Doctrine\Common\DoctrineException::updateMe('could not create sequence table'); } /** @@ -456,7 +456,7 @@ class SqliteSchemaManager extends AbstractSchemaManager public function alterTableSql($name, array $changes, $check = false) { if ( ! $name) { - throw new Doctrine_Export_Exception('no valid table name specified'); + throw \Doctrine\Common\DoctrineException::updateMe('no valid table name specified'); } foreach ($changes as $changeName => $change) { switch ($changeName) { @@ -466,7 +466,7 @@ class SqliteSchemaManager extends AbstractSchemaManager case 'name': break; default: - throw new Doctrine_Export_Exception('change type "' . $changeName . '" not yet supported'); + throw \Doctrine\Common\DoctrineException::updateMe('change type "' . $changeName . '" not yet supported'); } } diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 8f122e1e7..9b3e20f91 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -463,7 +463,7 @@ abstract class AbstractQuery } if ($value === null) { - throw new Doctrine_ORM_Query_Exception( 'Cannot try to set \''.$key.'\' without a value.' ); + throw \Doctrine\Common\DoctrineException::updateMe( 'Cannot try to set \''.$key.'\' without a value.' ); } return $this->_addDqlQueryPart('set', $key . ' = ' . $value, true); @@ -891,7 +891,7 @@ abstract class AbstractQuery public function getDqlQueryPart($queryPartName) { if ( ! isset($this->_dqlParts[$queryPartName])) { - throw new Doctrine_ORM_Query_Exception('Unknown DQL query part \'' . $queryPartName . '\''); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown DQL query part \'' . $queryPartName . '\''); } return $this->_dqlParts[$queryPartName]; diff --git a/lib/Doctrine/ORM/Cache/DbCache.php b/lib/Doctrine/ORM/Cache/DbCache.php index f25b9a053..1270fbbfb 100644 --- a/lib/Doctrine/ORM/Cache/DbCache.php +++ b/lib/Doctrine/ORM/Cache/DbCache.php @@ -43,13 +43,13 @@ class DbCache implements Cache, \Countable if ( ! isset($options['connection']) || ! ($options['connection'] instanceof Doctrine_DBAL_Connection)) { - throw new Doctrine_Exception('Connection option not set.'); + throw \Doctrine\Common\DoctrineException::updateMe('Connection option not set.'); } if ( ! isset($options['tableName']) || ! is_string($options['tableName'])) { - throw new Doctrine_Exception('Table name option not set.'); + throw \Doctrine\Common\DoctrineException::updateMe('Table name option not set.'); } $this->_options = $options; diff --git a/lib/Doctrine/ORM/Cache/MemcacheCache.php b/lib/Doctrine/ORM/Cache/MemcacheCache.php index be622a858..9857de710 100644 --- a/lib/Doctrine/ORM/Cache/MemcacheCache.php +++ b/lib/Doctrine/ORM/Cache/MemcacheCache.php @@ -43,7 +43,7 @@ class MemcacheCache implements Cache public function __construct() { if ( ! extension_loaded('memcache')) { - throw new Doctrine_Cache_Exception('In order to use Memcache driver, the memcache extension must be loaded.'); + throw \Doctrine\Common\DoctrineException::updateMe('In order to use Memcache driver, the memcache extension must be loaded.'); } } diff --git a/lib/Doctrine/ORM/Cache/XcacheCache.php b/lib/Doctrine/ORM/Cache/XcacheCache.php index dfd457b3b..33fee5a92 100644 --- a/lib/Doctrine/ORM/Cache/XcacheCache.php +++ b/lib/Doctrine/ORM/Cache/XcacheCache.php @@ -38,7 +38,7 @@ class XcacheCache implements Cache public function __construct() { if ( ! extension_loaded('xcache')) { - throw new Doctrine_Exception('In order to use Xcache driver, the xcache extension must be loaded.'); + throw \Doctrine\Common\DoctrineException::updateMe('In order to use Xcache driver, the xcache extension must be loaded.'); } } diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index 70a7b4887..849ec8886 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -203,7 +203,7 @@ class EntityRepository if (isset($by)) { if ( ! isset($arguments[0])) { - throw new Doctrine_Mapper_Exception('You must specify the value to findBy.'); + throw \Doctrine\Common\DoctrineException::updateMe('You must specify the value to findBy.'); } $fieldName = Doctrine::tableize($by); @@ -214,11 +214,11 @@ class EntityRepository } else if ($this->_classMetadata->hasRelation($by)) { $relation = $this->_classMetadata->getRelation($by); if ($relation['type'] === Doctrine_Relation::MANY) { - throw new Doctrine_Mapper_Exception('Cannot findBy many relationship.'); + throw \Doctrine\Common\DoctrineException::updateMe('Cannot findBy many relationship.'); } return $this->$method($relation['local'], $arguments[0], $hydrationMode); } else { - throw new Doctrine_Mapper_Exception('Cannot find by: ' . $by . '. Invalid field or relationship alias.'); + throw \Doctrine\Common\DoctrineException::updateMe('Cannot find by: ' . $by . '. Invalid field or relationship alias.'); } } } diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadata.php b/lib/Doctrine/ORM/Mapping/ClassMetadata.php index a95bc44ac..0fa9d9d18 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadata.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadata.php @@ -719,7 +719,7 @@ final class ClassMetadata public function getSingleIdentifierFieldName() { if ($this->_isIdentifierComposite) { - throw new Doctrine_Exception("Calling getSingleIdentifierFieldName " + throw \Doctrine\Common\DoctrineException::updateMe("Calling getSingleIdentifierFieldName " . "on a class that uses a composite identifier is not allowed."); } return $this->_identifier[0]; diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php index 10d363bc6..9bea3c0e4 100644 --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php @@ -70,7 +70,7 @@ class JoinedSubclassPersister extends AbstractEntityPersister $this->_insertRow($parentClass->getTableName(), $dataSet[$parent]); } } else { - throw new Doctrine_Mapper_Exception("Unsupported identifier type '$identifierType'."); + throw \Doctrine\Common\DoctrineException::updateMe("Unsupported identifier type '$identifierType'."); } $entity->_assignIdentifier($identifier); } else { @@ -243,7 +243,7 @@ class JoinedSubclassPersister extends AbstractEntityPersister } } - throw new Doctrine_Mapper_Exception("Unable to find defining class of field '$fieldName'."); + throw \Doctrine\Common\DoctrineException::updateMe("Unable to find defining class of field '$fieldName'."); }*/ /** diff --git a/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php b/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php index e1a13bb72..033c93d17 100644 --- a/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php @@ -91,7 +91,7 @@ class StandardEntityPersister extends AbstractEntityPersister $id = $conn->sequence->lastInsertId($seq); if ( ! $id) { - throw new Doctrine_Mapper_Exception("Couldn't get last insert identifier."); + throw \Doctrine\Common\DoctrineException::updateMe("Couldn't get last insert identifier."); } $record->assignIdentifier($id); diff --git a/lib/Doctrine/ORM/Query/AbstractResult.php b/lib/Doctrine/ORM/Query/AbstractResult.php index ffb9837a6..73035b824 100644 --- a/lib/Doctrine/ORM/Query/AbstractResult.php +++ b/lib/Doctrine/ORM/Query/AbstractResult.php @@ -198,7 +198,7 @@ abstract class AbstractResult public function getTableAlias($tableAlias) { if ( ! isset($this->_tableAliasMap[$tableAlias])) { - throw new Doctrine_ORM_Query_Exception('Unknown table alias ' . $tableAlias); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown table alias ' . $tableAlias); } return $this->_tableAliasMap[$tableAlias]; diff --git a/lib/Doctrine/ORM/Query/ParserResult.php b/lib/Doctrine/ORM/Query/ParserResult.php index 3569a492f..a2b052fa1 100644 --- a/lib/Doctrine/ORM/Query/ParserResult.php +++ b/lib/Doctrine/ORM/Query/ParserResult.php @@ -131,7 +131,7 @@ class ParserResult extends AbstractResult public function getQueryField($fieldAlias) { if ( ! isset($this->_queryFields[$fieldAlias])) { - throw new Doctrine_ORM_Query_Exception('Unknown query field ' . $fieldAlias); + throw \Doctrine\Common\DoctrineException::updateMe('Unknown query field ' . $fieldAlias); } return $this->_queryFields[$fieldAlias]; diff --git a/lib/Doctrine/ORM/Query/ParserRule.php b/lib/Doctrine/ORM/Query/ParserRule.php index 1c60d71ea..31cef97f5 100644 --- a/lib/Doctrine/ORM/Query/ParserRule.php +++ b/lib/Doctrine/ORM/Query/ParserRule.php @@ -157,7 +157,7 @@ abstract class ParserRule //TODO: This expensive check is not necessary. Should be removed at the end. // "new $class" will throw an error anyway if the class is not found. if ( ! class_exists($class)) { - throw new Doctrine_ORM_Query_Parser_Exception( + throw \Doctrine\Common\DoctrineException::updateMe( "Unknown Grammar Rule '$name'. Could not find related compiler class." ); } diff --git a/tests/Doctrine/Tests/Common/AllTests.php b/tests/Doctrine/Tests/Common/AllTests.php index 96328a1b2..8d8bbc2e2 100644 --- a/tests/Doctrine/Tests/Common/AllTests.php +++ b/tests/Doctrine/Tests/Common/AllTests.php @@ -21,11 +21,12 @@ class AllTests { $suite = new \Doctrine\Tests\DoctrineTestSuite('Doctrine Common Tests'); - $suite->addTestSuite('Doctrine\Tests\Common\EventManagerTest'); + $suite->addTestSuite('Doctrine\Tests\Common\DoctrineExceptionTest'); $suite->addTestSuite('Doctrine\Tests\Common\ClassLoaderTest'); + $suite->addTestSuite('Doctrine\Tests\Common\EventManagerTest'); $suite->addTest(Collections\AllTests::suite()); - + return $suite; } }