diff --git a/UPGRADE.md b/UPGRADE.md index ed3665931c5..0392cdad627 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -88,6 +88,7 @@ The non-interface methods of driver-level classes have been marked internal: The following classes under the `Driver` namespace have been deprecated in favor of their consistently named counterparts: +- `DriverException` → `Exception` - `AbstractDriverException` → `AbstractException` - `IBMDB2\DB2Driver` → `IBMDB2\Driver` - `IBMDB2\DB2Connection` → `IBMDB2\Connection` @@ -109,8 +110,7 @@ All driver-specific exception classes have been deprecated: - `PDOException` - `SQLSrv\SQLSrvException` -A driver-level exception should be only identified as a subtype of `Doctrine\DBAL\Driver\DriverException` -or when its wrapped as `Doctrine\DBAL\Exception\DriverException`. +A driver-level exception should be only identified as a subtype of `Driver\Exception`. Internal driver-level exception implementations may use `Driver\AbstractException` as the base class. Driver-specific exception handling has to be implemented either in the driver or based on the type of the `Driver` implementation. diff --git a/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php b/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php index a3697529e75..34381e23b1c 100644 --- a/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php +++ b/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php @@ -4,7 +4,7 @@ use ArrayIterator; use Doctrine\Common\Cache\Cache; -use Doctrine\DBAL\Driver\DriverException; +use Doctrine\DBAL\Driver\Exception; use Doctrine\DBAL\Driver\FetchUtils; use Doctrine\DBAL\Driver\Result; use Doctrine\DBAL\Driver\ResultStatement; @@ -297,7 +297,7 @@ public function free(): void /** * @return array|false * - * @throws DriverException + * @throws Exception */ private function doFetch() { diff --git a/lib/Doctrine/DBAL/DBALException.php b/lib/Doctrine/DBAL/DBALException.php index 46065871cdf..f208a14ae92 100644 --- a/lib/Doctrine/DBAL/DBALException.php +++ b/lib/Doctrine/DBAL/DBALException.php @@ -2,7 +2,7 @@ namespace Doctrine\DBAL; -use Doctrine\DBAL\Driver\DriverException as LowLevelDriverException; +use Doctrine\DBAL\Driver\DriverException as DeprecatedDriverException; use Doctrine\DBAL\Driver\ExceptionConverterDriver; use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -177,7 +177,7 @@ private static function wrapException(Driver $driver, Throwable $driverEx, strin return $driverEx; } - if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof LowLevelDriverException) { + if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof DeprecatedDriverException) { return $driver->convertException($msg, $driverEx); } diff --git a/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php b/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php index 33b39589b9b..93b3eaa33f5 100644 --- a/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php +++ b/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php @@ -85,7 +85,7 @@ public function convertException($message, DeprecatedDriverException $exception) return new TableExistsException($message, $exception); case '08006': - return new ConnectionException($message, $exception); + return new Exception\ConnectionException($message, $exception); case '7': // Prior to fixing https://bugs.php.net/bug.php?id=64705 (PHP 7.3.22 and PHP 7.4.10), diff --git a/lib/Doctrine/DBAL/Driver/DriverException.php b/lib/Doctrine/DBAL/Driver/DriverException.php index 2ee0dd98d0b..2e83e82bee1 100644 --- a/lib/Doctrine/DBAL/Driver/DriverException.php +++ b/lib/Doctrine/DBAL/Driver/DriverException.php @@ -1,34 +1,12 @@ > * - * @throws DriverException + * @throws Exception */ public static function fetchAllNumeric(Result $result): array { @@ -44,7 +44,7 @@ public static function fetchAllNumeric(Result $result): array /** * @return array> * - * @throws DriverException + * @throws Exception */ public static function fetchAllAssociative(Result $result): array { @@ -60,7 +60,7 @@ public static function fetchAllAssociative(Result $result): array /** * @return array * - * @throws DriverException + * @throws Exception */ public static function fetchFirstColumn(Result $result): array { diff --git a/lib/Doctrine/DBAL/Driver/PDO/Exception.php b/lib/Doctrine/DBAL/Driver/PDO/Exception.php new file mode 100644 index 00000000000..2febe021227 --- /dev/null +++ b/lib/Doctrine/DBAL/Driver/PDO/Exception.php @@ -0,0 +1,20 @@ +setAttribute(PDO::ATTR_STATEMENT_CLASS, [Statement::class, []]); $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } catch (OriginalPDOException $exception) { - throw PDOException::new($exception); + } catch (PDOException $exception) { + throw Exception::new($exception); } } @@ -50,8 +51,8 @@ public function exec($sql) assert($result !== false); return $result; - } catch (OriginalPDOException $exception) { - throw PDOException::new($exception); + } catch (PDOException $exception) { + throw Exception::new($exception); } } @@ -76,8 +77,8 @@ public function prepare($sql, $driverOptions = []) assert($statement instanceof PDOStatement); return $statement; - } catch (OriginalPDOException $exception) { - throw PDOException::new($exception); + } catch (PDOException $exception) { + throw Exception::new($exception); } } @@ -95,8 +96,8 @@ public function query() assert($stmt instanceof PDOStatement); return $stmt; - } catch (OriginalPDOException $exception) { - throw PDOException::new($exception); + } catch (PDOException $exception) { + throw Exception::new($exception); } } @@ -111,8 +112,8 @@ public function lastInsertId($name = null) } return parent::lastInsertId($name); - } catch (OriginalPDOException $exception) { - throw PDOException::new($exception); + } catch (PDOException $exception) { + throw Exception::new($exception); } } diff --git a/lib/Doctrine/DBAL/Driver/PDOException.php b/lib/Doctrine/DBAL/Driver/PDOException.php index cd8983b460e..b2c01eb4430 100644 --- a/lib/Doctrine/DBAL/Driver/PDOException.php +++ b/lib/Doctrine/DBAL/Driver/PDOException.php @@ -5,6 +5,8 @@ use Doctrine\DBAL\Driver\PDO\Exception; /** + * @deprecated Use {@link Exception} instead + * * @psalm-immutable */ class PDOException extends \PDOException implements DriverException @@ -23,11 +25,6 @@ class PDOException extends \PDOException implements DriverException */ private $sqlState; - public static function new(\PDOException $exception): self - { - return new self($exception); - } - /** * @param \PDOException $exception The PDO exception to wrap. */ diff --git a/lib/Doctrine/DBAL/Driver/PDOStatement.php b/lib/Doctrine/DBAL/Driver/PDOStatement.php index 274cd82f5ae..9ef5bf23b43 100644 --- a/lib/Doctrine/DBAL/Driver/PDOStatement.php +++ b/lib/Doctrine/DBAL/Driver/PDOStatement.php @@ -2,7 +2,7 @@ namespace Doctrine\DBAL\Driver; -use Doctrine\DBAL\Driver\PDOException as DoctrinePDOException; +use Doctrine\DBAL\Driver\PDO\Exception; use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\ParameterType; @@ -77,7 +77,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null) return parent::setFetchMode($fetchMode, $arg2, $arg3); } catch (PDOException $exception) { - throw DoctrinePDOException::new($exception); + throw Exception::new($exception); } } @@ -91,7 +91,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING) try { return parent::bindValue($param, $value, $type); } catch (PDOException $exception) { - throw DoctrinePDOException::new($exception); + throw Exception::new($exception); } } @@ -111,7 +111,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le try { return parent::bindParam($param, $variable, $type, ...array_slice(func_get_args(), 3)); } catch (PDOException $exception) { - throw DoctrinePDOException::new($exception); + throw Exception::new($exception); } } @@ -139,7 +139,7 @@ public function execute($params = null) try { return parent::execute($params); } catch (PDOException $exception) { - throw DoctrinePDOException::new($exception); + throw Exception::new($exception); } } @@ -159,7 +159,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX try { return parent::fetch(...$args); } catch (PDOException $exception) { - throw DoctrinePDOException::new($exception); + throw Exception::new($exception); } } @@ -192,7 +192,7 @@ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = n return $data; } catch (PDOException $exception) { - throw DoctrinePDOException::new($exception); + throw Exception::new($exception); } } @@ -206,7 +206,7 @@ public function fetchColumn($columnIndex = 0) try { return parent::fetchColumn($columnIndex); } catch (PDOException $exception) { - throw DoctrinePDOException::new($exception); + throw Exception::new($exception); } } diff --git a/lib/Doctrine/DBAL/Driver/Result.php b/lib/Doctrine/DBAL/Driver/Result.php index 65be0f03c49..a52f0563e4b 100644 --- a/lib/Doctrine/DBAL/Driver/Result.php +++ b/lib/Doctrine/DBAL/Driver/Result.php @@ -14,7 +14,7 @@ interface Result * * @return array|false * - * @throws DriverException + * @throws Exception */ public function fetchNumeric(); @@ -23,7 +23,7 @@ public function fetchNumeric(); * * @return array|false * - * @throws DriverException + * @throws Exception */ public function fetchAssociative(); @@ -32,7 +32,7 @@ public function fetchAssociative(); * * @return mixed|false * - * @throws DriverException + * @throws Exception */ public function fetchOne(); @@ -41,7 +41,7 @@ public function fetchOne(); * * @return array> * - * @throws DriverException + * @throws Exception */ public function fetchAllNumeric(): array; @@ -50,7 +50,7 @@ public function fetchAllNumeric(): array; * * @return array> * - * @throws DriverException + * @throws Exception */ public function fetchAllAssociative(): array; @@ -59,7 +59,7 @@ public function fetchAllAssociative(): array; * * @return array * - * @throws DriverException + * @throws Exception */ public function fetchFirstColumn(): array; diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php index ff9babb28e0..1542276dba2 100644 --- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php @@ -2,7 +2,7 @@ namespace Doctrine\DBAL\Driver\SQLAnywhere; -use Doctrine\DBAL\Driver\DriverException; +use Doctrine\DBAL\Driver\Exception; use Doctrine\DBAL\Driver\FetchUtils; use Doctrine\DBAL\Driver\Result; use Doctrine\DBAL\Driver\Statement; @@ -352,7 +352,7 @@ public function fetchAssociative() /** * {@inheritdoc} * - * @throws DriverException + * @throws Exception */ public function fetchOne() { @@ -362,7 +362,7 @@ public function fetchOne() /** * @return array> * - * @throws DriverException + * @throws Exception */ public function fetchAllNumeric(): array { @@ -372,7 +372,7 @@ public function fetchAllNumeric(): array /** * @return array> * - * @throws DriverException + * @throws Exception */ public function fetchAllAssociative(): array { @@ -382,7 +382,7 @@ public function fetchAllAssociative(): array /** * @return array * - * @throws DriverException + * @throws Exception */ public function fetchFirstColumn(): array { diff --git a/lib/Doctrine/DBAL/Exception/DriverException.php b/lib/Doctrine/DBAL/Exception/DriverException.php index e61f167102d..c0dd5d89d8a 100644 --- a/lib/Doctrine/DBAL/Exception/DriverException.php +++ b/lib/Doctrine/DBAL/Exception/DriverException.php @@ -3,7 +3,7 @@ namespace Doctrine\DBAL\Exception; use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\DriverException as LowLevelDriverException; +use Doctrine\DBAL\Driver\DriverException as DeprecatedDriverException; use Exception; /** @@ -16,15 +16,15 @@ class DriverException extends DBALException /** * The previous DBAL driver exception. * - * @var LowLevelDriverException + * @var DeprecatedDriverException */ private $driverException; /** - * @param string $message The exception message. - * @param LowLevelDriverException $driverException The DBAL driver exception to chain. + * @param string $message The exception message. + * @param DeprecatedDriverException $driverException The DBAL driver exception to chain. */ - public function __construct($message, LowLevelDriverException $driverException) + public function __construct($message, DeprecatedDriverException $driverException) { $exception = null; diff --git a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php index 3b21741e678..e8732667a75 100644 --- a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php @@ -3,7 +3,7 @@ namespace Doctrine\DBAL\Schema; use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\DriverException; +use Doctrine\DBAL\Driver\Exception; use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Types\Type; use Throwable; @@ -37,7 +37,7 @@ public function dropDatabase($database) $exception = $exception->getPrevious(); assert($exception instanceof Throwable); - if (! $exception instanceof DriverException) { + if (! $exception instanceof Exception) { throw $exception; } diff --git a/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php b/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php index 1e57ca94070..63dc9b04f87 100644 --- a/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php @@ -3,7 +3,7 @@ namespace Doctrine\DBAL\Schema; use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\DriverException; +use Doctrine\DBAL\Driver\Exception; use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Types\Type; use PDOException; @@ -35,7 +35,7 @@ public function dropDatabase($database) $exception = $exception->getPrevious(); assert($exception instanceof Throwable); - if (! $exception instanceof DriverException) { + if (! $exception instanceof Exception) { throw $exception; } diff --git a/lib/Doctrine/DBAL/Statement.php b/lib/Doctrine/DBAL/Statement.php index cc8d3db0884..080c48e2061 100644 --- a/lib/Doctrine/DBAL/Statement.php +++ b/lib/Doctrine/DBAL/Statement.php @@ -3,7 +3,7 @@ namespace Doctrine\DBAL; use Doctrine\DBAL\Abstraction\Result; -use Doctrine\DBAL\Driver\DriverException; +use Doctrine\DBAL\Driver\Exception; use Doctrine\DBAL\Driver\Statement as DriverStatement; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Type; @@ -290,7 +290,7 @@ public function fetchNumeric() } return $this->stmt->fetch(FetchMode::NUMERIC); - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -308,7 +308,7 @@ public function fetchAssociative() } return $this->stmt->fetch(FetchMode::ASSOCIATIVE); - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -326,7 +326,7 @@ public function fetchOne() } return $this->stmt->fetch(FetchMode::COLUMN); - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -344,7 +344,7 @@ public function fetchAllNumeric(): array } return $this->stmt->fetchAll(FetchMode::NUMERIC); - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -362,7 +362,7 @@ public function fetchAllAssociative(): array } return $this->stmt->fetchAll(FetchMode::ASSOCIATIVE); - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -380,7 +380,7 @@ public function fetchFirstColumn(): array } return $this->stmt->fetchAll(FetchMode::COLUMN); - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -404,7 +404,7 @@ public function iterateNumeric(): Traversable yield $row; } } - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -428,7 +428,7 @@ public function iterateAssociative(): Traversable yield $row; } } - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } @@ -452,7 +452,7 @@ public function iterateColumn(): Traversable yield $value; } } - } catch (DriverException $e) { + } catch (Exception $e) { $this->conn->handleDriverException($e); } } diff --git a/tests/Doctrine/Tests/DBAL/Driver/PDO/PDOExceptionTest.php b/tests/Doctrine/Tests/DBAL/Driver/PDO/ExceptionTest.php similarity index 87% rename from tests/Doctrine/Tests/DBAL/Driver/PDO/PDOExceptionTest.php rename to tests/Doctrine/Tests/DBAL/Driver/PDO/ExceptionTest.php index e554fb9c12b..4ba493ab2ee 100644 --- a/tests/Doctrine/Tests/DBAL/Driver/PDO/PDOExceptionTest.php +++ b/tests/Doctrine/Tests/DBAL/Driver/PDO/ExceptionTest.php @@ -2,7 +2,7 @@ namespace Doctrine\Tests\DBAL\Driver\PDO; -use Doctrine\DBAL\Driver\PDOException as DoctrinePDOException; +use Doctrine\DBAL\Driver\PDO\Exception; use Doctrine\Tests\DbalTestCase; use PDOException; use PHPUnit\Framework\MockObject\MockObject; @@ -10,7 +10,7 @@ /** * @requires extension pdo */ -class PDOExceptionTest extends DbalTestCase +class ExceptionTest extends DbalTestCase { public const ERROR_CODE = 666; @@ -21,7 +21,7 @@ class PDOExceptionTest extends DbalTestCase /** * The PDO exception wrapper under test. * - * @var DoctrinePDOException + * @var Exception */ private $exception; @@ -40,7 +40,7 @@ protected function setUp(): void $this->wrappedException->errorInfo = [self::SQLSTATE, self::ERROR_CODE]; - $this->exception = new DoctrinePDOException($this->wrappedException); + $this->exception = new Exception($this->wrappedException); } public function testReturnsCode(): void diff --git a/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php index 253101f50b4..f54cb07b06a 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php @@ -3,10 +3,10 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDO; use Doctrine\DBAL\Driver\PDO\Connection; +use Doctrine\DBAL\Driver\PDO\Exception; use Doctrine\DBAL\Driver\PDO\OCI\Driver as PDOOCIDriver; use Doctrine\DBAL\Driver\PDO\PgSQL\Driver as PDOPgSQLDriver; use Doctrine\DBAL\Driver\PDO\SQLSrv\Driver as PDOSQLSrvDriver; -use Doctrine\DBAL\Driver\PDOException; use Doctrine\Tests\DbalFunctionalTestCase; use PDO; @@ -52,14 +52,14 @@ public function testDoesNotRequireQueryForServerVersion(): void public function testThrowsWrappedExceptionOnConstruct(): void { - $this->expectException(PDOException::class); + $this->expectException(Exception::class); new Connection('foo'); } public function testThrowsWrappedExceptionOnExec(): void { - $this->expectException(PDOException::class); + $this->expectException(Exception::class); $this->driverConnection->exec('foo'); } @@ -89,14 +89,14 @@ public function testThrowsWrappedExceptionOnPrepare(): void // so that PDO actually communicates with the database server to check the query. $this->driverConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); - $this->expectException(PDOException::class); + $this->expectException(Exception::class); $this->driverConnection->prepare('foo'); } public function testThrowsWrappedExceptionOnQuery(): void { - $this->expectException(PDOException::class); + $this->expectException(Exception::class); $this->driverConnection->query('foo'); } diff --git a/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php b/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php index 306057796f1..d5640e3b7aa 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php @@ -3,7 +3,7 @@ namespace Doctrine\Tests\DBAL\Functional; use DateTime; -use Doctrine\DBAL\Driver\DriverException; +use Doctrine\DBAL\Driver\Exception; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Schema\Sequence; use Doctrine\DBAL\Schema\Table; @@ -369,13 +369,13 @@ public function testDeleteWhereIsNull(): void * * @return string|false * - * @throws DriverException + * @throws Exception */ private function lastInsertId(?string $name = null) { try { return $this->connection->lastInsertId($name); - } catch (DriverException $e) { + } catch (Exception $e) { if ($e->getCode() === 'IM001') { $this->markTestSkipped($e->getMessage()); } diff --git a/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php b/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php index eef443b8ef2..5e90a8e3c50 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php @@ -264,7 +264,7 @@ public function testGeneratesForeignKeySqlOnlyWhenSupportingForeignKeys(): void if ($this->platform->supportsForeignKeyConstraints()) { self::assertIsString($this->platform->getCreateForeignKeySQL($fk, 'test')); } else { - $this->expectException(DBALException::class); + $this->expectException(Exception::class); $this->platform->getCreateForeignKeySQL($fk, 'test'); } } diff --git a/tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php b/tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php index fba77a86756..6c166ac2dff 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php @@ -469,6 +469,9 @@ public function testModifyLimitQueryWithAggregateFunctionInOrderByClause(): void $this->expectCteWithMaxRowNum($alteredSql, 1, $sql); } + /** + * @throws DBALException + */ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromBaseTable(): void { $querySql = 'SELECT DISTINCT id_0, name_1 ' @@ -490,6 +493,9 @@ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromBas $this->expectCteWithMaxRowNum($alteredSql, 5, $sql); } + /** + * @throws DBALException + */ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromJoinTable(): void { $querySql = 'SELECT DISTINCT id_0, name_1 ' @@ -511,6 +517,9 @@ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromJoi $this->expectCteWithMaxRowNum($alteredSql, 5, $sql); } + /** + * @throws DBALException + */ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnsFromBothTables(): void { $querySql = 'SELECT DISTINCT id_0, name_1, foo_2 ' diff --git a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php index 1c21098b678..47fe7ec69b3 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php @@ -2,6 +2,7 @@ namespace Doctrine\Tests\DBAL\Platforms; +use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform; use Doctrine\DBAL\Schema\Sequence; @@ -369,6 +370,9 @@ public function testModifyLimitQueryWithComplexOrderByExpression(): void self::assertEquals($sql, $expected); } + /** + * @throws DBALException + */ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromBaseTable(): void { $querySql = 'SELECT DISTINCT id_0, name_1 ' @@ -389,6 +393,9 @@ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromBas self::assertEquals($alteredSql, $sql); } + /** + * @throws DBALException + */ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromJoinTable(): void { $querySql = 'SELECT DISTINCT id_0, name_1 ' @@ -409,6 +416,9 @@ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnFromJoi self::assertEquals($alteredSql, $sql); } + /** + * @throws DBALException + */ public function testModifyLimitSubqueryWithJoinAndSubqueryOrderedByColumnsFromBothTables(): void { $querySql = 'SELECT DISTINCT id_0, name_1, foo_2 '