diff --git a/composer.json b/composer.json index 3128233..b9056a4 100644 --- a/composer.json +++ b/composer.json @@ -1,44 +1,61 @@ { - "name": "scienta/doctrine-json-functions", + "name": "scienta/doctrine-json-functions", "abandoned": false, - "type": "library", - "description": "A set of extensions to Doctrine 2 that add support for json query functions.", - "keywords": ["doctrine", "orm", "json", "dql", "database", "mysql", "postgres", "postgresql", "mariadb", "sqlite"], - "license": "MIT", - "authors": [ - { - "name": "Doctrine Json Functions Contributors", - "homepage": "https://github.com/ScientaNL/DoctrineJsonFunctions/contributors" - } - ], - "require": { - "php": "^7.1 || ^8.0", - "ext-pdo": "*", - "doctrine/orm": "2.*", - "doctrine/dbal": "2.*" - }, - "require-dev": { - "doctrine/orm": "^2.7", - "doctrine/coding-standard": "^8.0 || ^9.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "autoload": { - "psr-4": { - "Scienta\\DoctrineJsonFunctions\\" : "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Doctrine\\Tests\\": "tests/Doctrine/Tests", - "Scienta\\DoctrineJsonFunctions\\Tests\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "suggest": { - "dunglas/doctrine-json-odm": "To serialize / deserialize objects as JSON documents." - } + "type": "library", + "description": "A set of extensions to Doctrine 2 that add support for json query functions.", + "keywords": [ + "doctrine", + "orm", + "json", + "dql", + "database", + "mysql", + "postgres", + "postgresql", + "mariadb", + "sqlite" + ], + "license": "MIT", + "authors": [ + { + "name": "Doctrine Json Functions Contributors", + "homepage": "https://github.com/ScientaNL/DoctrineJsonFunctions/contributors" + } + ], + "require": { + "php": "^7.3 || ^8.0", + "ext-pdo": "*", + "doctrine/orm": "^2.0", + "doctrine/dbal": "^3.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0 || ^9.0", + "phpunit/phpunit": "^8.0 || ^9.0", + "doctrine/annotations": "^1.13" + }, + "autoload": { + "psr-4": { + "Scienta\\DoctrineJsonFunctions\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Doctrine\\Tests\\": "tests/Doctrine/Tests", + "Scienta\\DoctrineJsonFunctions\\Tests\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "suggest": { + "dunglas/doctrine-json-odm": "To serialize / deserialize objects as JSON documents." + }, + "config": { + "allow-plugins": { + "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } + } } diff --git a/src/Query/AST/Functions/AbstractJsonFunctionNode.php b/src/Query/AST/Functions/AbstractJsonFunctionNode.php index ec1b909..cc46ff4 100644 --- a/src/Query/AST/Functions/AbstractJsonFunctionNode.php +++ b/src/Query/AST/Functions/AbstractJsonFunctionNode.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Literal; use Doctrine\ORM\Query\AST\Node; @@ -153,7 +153,7 @@ private function matchStringLiteral(Parser $parser, Lexer $lexer): Literal /** * @param SqlWalker $sqlWalker * @return string - * @throws DBALException + * @throws Exception * @throws \Doctrine\ORM\Query\AST\ASTException */ public function getSql(SqlWalker $sqlWalker): string @@ -190,7 +190,7 @@ protected function getSQLFunction(): string /** * @param SqlWalker $sqlWalker - * @throws DBALException + * @throws Exception */ abstract protected function validatePlatform(SqlWalker $sqlWalker): void; } diff --git a/src/Query/AST/Functions/Mariadb/MariadbJsonFunctionNode.php b/src/Query/AST/Functions/Mariadb/MariadbJsonFunctionNode.php index 06064ad..6702e3f 100644 --- a/src/Query/AST/Functions/Mariadb/MariadbJsonFunctionNode.php +++ b/src/Query/AST/Functions/Mariadb/MariadbJsonFunctionNode.php @@ -2,8 +2,8 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\ORM\Query\SqlWalker; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\AbstractJsonFunctionNode; @@ -11,12 +11,12 @@ abstract class MariadbJsonFunctionNode extends AbstractJsonFunctionNode { /** * @param SqlWalker $sqlWalker - * @throws DBALException + * @throws Exception */ protected function validatePlatform(SqlWalker$sqlWalker): void { - if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof MySqlPlatform) { - throw DBALException::notSupported(static::FUNCTION_NAME); + if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof MySQLPlatform) { + throw Exception::notSupported(static::FUNCTION_NAME); } } } diff --git a/src/Query/AST/Functions/Mysql/JsonContains.php b/src/Query/AST/Functions/Mysql/JsonContains.php index 9466f2a..d2b75b3 100644 --- a/src/Query/AST/Functions/Mysql/JsonContains.php +++ b/src/Query/AST/Functions/Mysql/JsonContains.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_CONTAINS" "(" StringPrimary "," StringPrimary {"," StringPrimary } ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonContainsPath.php b/src/Query/AST/Functions/Mysql/JsonContainsPath.php index 076bc73..52c6c4e 100755 --- a/src/Query/AST/Functions/Mysql/JsonContainsPath.php +++ b/src/Query/AST/Functions/Mysql/JsonContainsPath.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; @@ -15,7 +15,7 @@ class JsonContainsPath extends JsonSearch /** * @param Parser $parser - * @throws DBALException + * @throws Exception * @throws \Doctrine\ORM\Query\QueryException */ public function parse(Parser $parser): void diff --git a/src/Query/AST/Functions/Mysql/JsonExtract.php b/src/Query/AST/Functions/Mysql/JsonExtract.php index eac44f9..d94fc4e 100644 --- a/src/Query/AST/Functions/Mysql/JsonExtract.php +++ b/src/Query/AST/Functions/Mysql/JsonExtract.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_EXTRACT" "(" StringPrimary "," StringPrimary {"," StringPrimary }* ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonKeys.php b/src/Query/AST/Functions/Mysql/JsonKeys.php index a7ac9f7..362921c 100644 --- a/src/Query/AST/Functions/Mysql/JsonKeys.php +++ b/src/Query/AST/Functions/Mysql/JsonKeys.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_KEYS" "(" StringPrimary {"," StringPrimary } ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonMerge.php b/src/Query/AST/Functions/Mysql/JsonMerge.php index 334bd95..a0a8f36 100644 --- a/src/Query/AST/Functions/Mysql/JsonMerge.php +++ b/src/Query/AST/Functions/Mysql/JsonMerge.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_MERGE" "(" StringPrimary "," StringPrimary { "," StringPrimary }* ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonMergePatch.php b/src/Query/AST/Functions/Mysql/JsonMergePatch.php index 52bf41a..7c00f89 100644 --- a/src/Query/AST/Functions/Mysql/JsonMergePatch.php +++ b/src/Query/AST/Functions/Mysql/JsonMergePatch.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_MERGE_PATCH" "(" StringPrimary "," StringPrimary { "," StringPrimary }* ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonOverlaps.php b/src/Query/AST/Functions/Mysql/JsonOverlaps.php index db98b7e..50c9962 100644 --- a/src/Query/AST/Functions/Mysql/JsonOverlaps.php +++ b/src/Query/AST/Functions/Mysql/JsonOverlaps.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_OVERLAPS" "(" StringPrimary "," StringPrimary ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonPretty.php b/src/Query/AST/Functions/Mysql/JsonPretty.php index 5c5a78d..f7406cf 100644 --- a/src/Query/AST/Functions/Mysql/JsonPretty.php +++ b/src/Query/AST/Functions/Mysql/JsonPretty.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_PRETTY" "(" NewValue ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonQuote.php b/src/Query/AST/Functions/Mysql/JsonQuote.php index 209248f..e8fe444 100644 --- a/src/Query/AST/Functions/Mysql/JsonQuote.php +++ b/src/Query/AST/Functions/Mysql/JsonQuote.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_QUOTE" "(" NewValue ")" */ diff --git a/src/Query/AST/Functions/Mysql/JsonSearch.php b/src/Query/AST/Functions/Mysql/JsonSearch.php index 99d6b1d..99cde70 100755 --- a/src/Query/AST/Functions/Mysql/JsonSearch.php +++ b/src/Query/AST/Functions/Mysql/JsonSearch.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\ORM\Query\AST\Node; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; @@ -31,7 +31,7 @@ class JsonSearch extends MysqlJsonFunctionNode /** * @param Parser $parser - * @throws DBALException + * @throws Exception * @throws \Doctrine\ORM\Query\QueryException */ public function parse(Parser $parser): void @@ -61,7 +61,7 @@ public function parse(Parser $parser): void /** * @param Parser $parser - * @throws DBALException + * @throws Exception * @return Node */ protected function parsePathMode(Parser $parser) @@ -78,6 +78,6 @@ protected function parsePathMode(Parser $parser) return $parser->Literal(); } - throw DBALException::notSupported("Mode '$value' is not supported by " . static::FUNCTION_NAME . "."); + throw Exception::notSupported("Mode '$value' is not supported by " . static::FUNCTION_NAME . "."); } } diff --git a/src/Query/AST/Functions/Mysql/JsonType.php b/src/Query/AST/Functions/Mysql/JsonType.php index 3111605..d9b69ea 100644 --- a/src/Query/AST/Functions/Mysql/JsonType.php +++ b/src/Query/AST/Functions/Mysql/JsonType.php @@ -2,13 +2,6 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\SqlWalker; - /** * "JSON_TYPE" "(" StringPrimary ")" */ diff --git a/src/Query/AST/Functions/Mysql/MysqlJsonFunctionNode.php b/src/Query/AST/Functions/Mysql/MysqlJsonFunctionNode.php index 9283a1c..7662f3d 100644 --- a/src/Query/AST/Functions/Mysql/MysqlJsonFunctionNode.php +++ b/src/Query/AST/Functions/Mysql/MysqlJsonFunctionNode.php @@ -2,8 +2,8 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\MySqlPlatform; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\ORM\Query\SqlWalker; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\AbstractJsonFunctionNode; @@ -11,12 +11,12 @@ abstract class MysqlJsonFunctionNode extends AbstractJsonFunctionNode { /** * @param SqlWalker $sqlWalker - * @throws DBALException + * @throws Exception */ protected function validatePlatform(SqlWalker$sqlWalker): void { - if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof MySqlPlatform) { - throw DBALException::notSupported(static::FUNCTION_NAME); + if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof MySQLPlatform) { + throw Exception::notSupported(static::FUNCTION_NAME); } } } diff --git a/src/Query/AST/Functions/Postgresql/PostgresqlJsonFunctionNode.php b/src/Query/AST/Functions/Postgresql/PostgresqlJsonFunctionNode.php index 911292a..5e48fa1 100644 --- a/src/Query/AST/Functions/Postgresql/PostgresqlJsonFunctionNode.php +++ b/src/Query/AST/Functions/Postgresql/PostgresqlJsonFunctionNode.php @@ -2,8 +2,8 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use Doctrine\ORM\Query\SqlWalker; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\AbstractJsonFunctionNode; @@ -11,12 +11,12 @@ abstract class PostgresqlJsonFunctionNode extends AbstractJsonFunctionNode { /** * @param SqlWalker $sqlWalker - * @throws DBALException + * @throws Exception */ protected function validatePlatform(SqlWalker$sqlWalker): void { - if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform) { - throw DBALException::notSupported(static::FUNCTION_NAME); + if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof PostgreSQL94Platform) { + throw Exception::notSupported(static::FUNCTION_NAME); } } diff --git a/src/Query/AST/Functions/Postgresql/PostgresqlJsonOperatorFunctionNode.php b/src/Query/AST/Functions/Postgresql/PostgresqlJsonOperatorFunctionNode.php index 836e775..3e42733 100644 --- a/src/Query/AST/Functions/Postgresql/PostgresqlJsonOperatorFunctionNode.php +++ b/src/Query/AST/Functions/Postgresql/PostgresqlJsonOperatorFunctionNode.php @@ -2,8 +2,8 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use Doctrine\ORM\Query\SqlWalker; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\AbstractJsonOperatorFunctionNode; @@ -13,12 +13,12 @@ abstract class PostgresqlJsonOperatorFunctionNode extends AbstractJsonOperatorFu /** * @param SqlWalker $sqlWalker - * @throws DBALException + * @throws Exception */ protected function validatePlatform(SqlWalker$sqlWalker): void { - if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform) { - throw DBALException::notSupported(static::FUNCTION_NAME); + if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof PostgreSQL94Platform) { + throw Exception::notSupported(static::FUNCTION_NAME); } } diff --git a/src/Query/AST/Functions/Sqlite/SqliteJsonFunctionNode.php b/src/Query/AST/Functions/Sqlite/SqliteJsonFunctionNode.php index f4f1333..a3c2d31 100644 --- a/src/Query/AST/Functions/Sqlite/SqliteJsonFunctionNode.php +++ b/src/Query/AST/Functions/Sqlite/SqliteJsonFunctionNode.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Sqlite; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\ORM\Query\SqlWalker; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\AbstractJsonFunctionNode; @@ -11,12 +11,12 @@ abstract class SqliteJsonFunctionNode extends AbstractJsonFunctionNode { /** * @param SqlWalker $sqlWalker - * @throws DBALException + * @throws Exception */ protected function validatePlatform(SqlWalker$sqlWalker): void { if (!$sqlWalker->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) { - throw DBALException::notSupported(static::FUNCTION_NAME); + throw Exception::notSupported(static::FUNCTION_NAME); } } } diff --git a/tests/Mocks/ConnectionMock.php b/tests/Mocks/ConnectionMock.php index 0ffd0d8..5697191 100644 --- a/tests/Mocks/ConnectionMock.php +++ b/tests/Mocks/ConnectionMock.php @@ -4,6 +4,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver\Statement; +use Doctrine\DBAL\Result; /** * Mock class for Connection. @@ -21,7 +22,7 @@ class ConnectionMock extends Connection private $_fetchOneException; /** - * @var Statement|null + * @var Result|null */ private $_queryResult; @@ -50,7 +51,7 @@ class ConnectionMock extends Connection * @param \Doctrine\DBAL\Driver $driver * @param \Doctrine\DBAL\Configuration|null $config * @param \Doctrine\Common\EventManager|null $eventManager - * @throws \Doctrine\DBAL\DBALException + * @throws \Doctrine\DBAL\Exception */ public function __construct(array $params, $driver, $config = null, $eventManager = null) { @@ -81,9 +82,11 @@ public function insert($tableName, array $data, array $types = []) /** * {@inheritdoc} */ - public function executeUpdate($query, array $params = [], array $types = []) + public function executeUpdate($query, array $params = [], array $types = []):int { $this->_executeUpdates[] = ['query' => $query, 'params' => $params, 'types' => $types]; + + return 0; } /** @@ -110,7 +113,7 @@ public function fetchColumn($statement, array $params = [], $colnum = 0, array $ /** * {@inheritdoc} */ - public function query() : Statement + public function query(string $sql) : Result { return $this->_queryResult; } @@ -169,9 +172,9 @@ public function setLastInsertId($id) } /** - * @param Statement $result + * @param Result $result */ - public function setQueryResult(Statement $result) + public function setQueryResult(Result $result) { $this->_queryResult = $result; } diff --git a/tests/Mocks/DatabasePlatformMock.php b/tests/Mocks/DatabasePlatformMock.php index 76d148e..acbdfc9 100644 --- a/tests/Mocks/DatabasePlatformMock.php +++ b/tests/Mocks/DatabasePlatformMock.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Mocks; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\AbstractPlatform; /** @@ -20,25 +20,20 @@ class DatabasePlatformMock extends AbstractPlatform */ private $_prefersIdentityColumns = true; - /** - * @var bool - */ - private $_prefersSequences = false; - /** * {@inheritdoc} */ - public function prefersIdentityColumns() - { - return $this->_prefersIdentityColumns; + public function supportsIdentityColumns() { + return true; } + /** * {@inheritdoc} */ - public function prefersSequences() + public function prefersIdentityColumns() { - return $this->_prefersSequences; + return $this->_prefersIdentityColumns; } /** @@ -110,16 +105,6 @@ public function setPrefersIdentityColumns($bool) $this->_prefersIdentityColumns = $bool; } - /** - * @param bool $bool - * - * @return void - */ - public function setPrefersSequences($bool) - { - $this->_prefersSequences = $bool; - } - /** * @param string $sql * @@ -148,10 +133,14 @@ protected function initializeDoctrineTypeMappings() /** * @param array $field * @return string|void - * @throws DBALException + * @throws Exception */ public function getBlobTypeDeclarationSQL(array $field) { - throw DBALException::notSupported(__METHOD__); + throw Exception::notSupported(__METHOD__); + } + + public function getCurrentDatabaseExpression(): string { + throw Exception::notSupported(__METHOD__); } } diff --git a/tests/Mocks/DriverMock.php b/tests/Mocks/DriverMock.php index 4febcd8..11d9cbd 100644 --- a/tests/Mocks/DriverMock.php +++ b/tests/Mocks/DriverMock.php @@ -2,6 +2,9 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Mocks; +use Doctrine\DBAL\Driver\API\ExceptionConverter; +use Doctrine\DBAL\Exception; + /** * Mock class for Driver. */ @@ -39,7 +42,7 @@ public function getDatabasePlatform() /** * {@inheritdoc} */ - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) + public function getSchemaManager(\Doctrine\DBAL\Connection $conn, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) { if ($this->_schemaManagerMock == null) { return new SchemaManagerMock($conn); @@ -90,4 +93,8 @@ public function convertExceptionCode(\Exception $exception) { return 0; } + + public function getExceptionConverter(): ExceptionConverter { + throw Exception::notSupported(__METHOD__); + } } diff --git a/tests/Query/Functions/Mysql/JsonArrayAppendTest.php b/tests/Query/Functions/Mysql/JsonArrayAppendTest.php index 5c0f8a2..7301c04 100644 --- a/tests/Query/Functions/Mysql/JsonArrayAppendTest.php +++ b/tests/Query/Functions/Mysql/JsonArrayAppendTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonArrayAppendTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonArrayInsertTest.php b/tests/Query/Functions/Mysql/JsonArrayInsertTest.php index b04971c..7842ce6 100644 --- a/tests/Query/Functions/Mysql/JsonArrayInsertTest.php +++ b/tests/Query/Functions/Mysql/JsonArrayInsertTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonArrayInsertTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonArrayTest.php b/tests/Query/Functions/Mysql/JsonArrayTest.php index 90728b8..5d8f00b 100644 --- a/tests/Query/Functions/Mysql/JsonArrayTest.php +++ b/tests/Query/Functions/Mysql/JsonArrayTest.php @@ -2,8 +2,8 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; -use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; use Doctrine\ORM\Query\Expr; +use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; class JsonArrayTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonContainsPathTest.php b/tests/Query/Functions/Mysql/JsonContainsPathTest.php index 5373492..80b2cf2 100644 --- a/tests/Query/Functions/Mysql/JsonContainsPathTest.php +++ b/tests/Query/Functions/Mysql/JsonContainsPathTest.php @@ -24,7 +24,7 @@ public function testJsonContainsPathAll() public function testJsonContainsPathNone() { - $this->expectException(\Doctrine\DBAL\DBALException::class); + $this->expectException(\Doctrine\DBAL\Exception::class); $this->assertDqlProducesSql( "SELECT JSON_CONTAINS_PATH('{\"a\": 1, \"b\": 2, \"c\": {\"d\": 4}}', 'none', '$.a', '$.e') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", diff --git a/tests/Query/Functions/Mysql/JsonContainsTest.php b/tests/Query/Functions/Mysql/JsonContainsTest.php index 0a8f16f..93b3c94 100644 --- a/tests/Query/Functions/Mysql/JsonContainsTest.php +++ b/tests/Query/Functions/Mysql/JsonContainsTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonContainsTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonDepthTest.php b/tests/Query/Functions/Mysql/JsonDepthTest.php index 96955f0..0a78c70 100644 --- a/tests/Query/Functions/Mysql/JsonDepthTest.php +++ b/tests/Query/Functions/Mysql/JsonDepthTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonDepthTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonExctractTest.php b/tests/Query/Functions/Mysql/JsonExctractTest.php index f1eb61d..f1876ed 100644 --- a/tests/Query/Functions/Mysql/JsonExctractTest.php +++ b/tests/Query/Functions/Mysql/JsonExctractTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonExctractTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonInsertTest.php b/tests/Query/Functions/Mysql/JsonInsertTest.php index c376bed..df7c756 100644 --- a/tests/Query/Functions/Mysql/JsonInsertTest.php +++ b/tests/Query/Functions/Mysql/JsonInsertTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonInsertTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonKeysTest.php b/tests/Query/Functions/Mysql/JsonKeysTest.php index 243e448..1d3b69f 100644 --- a/tests/Query/Functions/Mysql/JsonKeysTest.php +++ b/tests/Query/Functions/Mysql/JsonKeysTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonKeysTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonLengthTest.php b/tests/Query/Functions/Mysql/JsonLengthTest.php index 803f248..383341c 100644 --- a/tests/Query/Functions/Mysql/JsonLengthTest.php +++ b/tests/Query/Functions/Mysql/JsonLengthTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonLengthTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonMergePatchTest.php b/tests/Query/Functions/Mysql/JsonMergePatchTest.php index 7df0a1f..30eb6e2 100644 --- a/tests/Query/Functions/Mysql/JsonMergePatchTest.php +++ b/tests/Query/Functions/Mysql/JsonMergePatchTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonMergePatchTestTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonMergeTest.php b/tests/Query/Functions/Mysql/JsonMergeTest.php index 6cece51..7c97946 100644 --- a/tests/Query/Functions/Mysql/JsonMergeTest.php +++ b/tests/Query/Functions/Mysql/JsonMergeTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonMergeTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonObjectTest.php b/tests/Query/Functions/Mysql/JsonObjectTest.php index 4fc43cf..0e65600 100644 --- a/tests/Query/Functions/Mysql/JsonObjectTest.php +++ b/tests/Query/Functions/Mysql/JsonObjectTest.php @@ -2,8 +2,8 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; -use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; use Doctrine\ORM\Query\Expr; +use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; class JsonObjectTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonOverlapsTest.php b/tests/Query/Functions/Mysql/JsonOverlapsTest.php index 610b21c..ed87630 100644 --- a/tests/Query/Functions/Mysql/JsonOverlapsTest.php +++ b/tests/Query/Functions/Mysql/JsonOverlapsTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonOverlapsTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonPrettyTest.php b/tests/Query/Functions/Mysql/JsonPrettyTest.php index 271b462..e60f933 100644 --- a/tests/Query/Functions/Mysql/JsonPrettyTest.php +++ b/tests/Query/Functions/Mysql/JsonPrettyTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonPrettyTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonQuoteTest.php b/tests/Query/Functions/Mysql/JsonQuoteTest.php index e84de74..a1d35da 100644 --- a/tests/Query/Functions/Mysql/JsonQuoteTest.php +++ b/tests/Query/Functions/Mysql/JsonQuoteTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonQuoteTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonRemoveTest.php b/tests/Query/Functions/Mysql/JsonRemoveTest.php index 84d7a29..f74041f 100644 --- a/tests/Query/Functions/Mysql/JsonRemoveTest.php +++ b/tests/Query/Functions/Mysql/JsonRemoveTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonRemoveTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonReplaceTest.php b/tests/Query/Functions/Mysql/JsonReplaceTest.php index 788c69d..f61ba53 100644 --- a/tests/Query/Functions/Mysql/JsonReplaceTest.php +++ b/tests/Query/Functions/Mysql/JsonReplaceTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonReplaceTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonSearchTest.php b/tests/Query/Functions/Mysql/JsonSearchTest.php index 466f36f..aa8c806 100644 --- a/tests/Query/Functions/Mysql/JsonSearchTest.php +++ b/tests/Query/Functions/Mysql/JsonSearchTest.php @@ -31,7 +31,7 @@ public function testJsonSearchAll() public function testJsonSearchNone() { - $this->expectException(\Doctrine\DBAL\DBALException::class); + $this->expectException(\Doctrine\DBAL\Exception::class); $this->assertDqlProducesSql( "SELECT JSON_SEARCH('[\"abc\", [{\"k\": \"10\"}, \"def\"], {\"x\":\"abc\"}, {\"y\":\"bcd\"}]', 'none', '$.a') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", diff --git a/tests/Query/Functions/Mysql/JsonSetTest.php b/tests/Query/Functions/Mysql/JsonSetTest.php index e09289a..5e55297 100644 --- a/tests/Query/Functions/Mysql/JsonSetTest.php +++ b/tests/Query/Functions/Mysql/JsonSetTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonSetTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonTypeTest.php b/tests/Query/Functions/Mysql/JsonTypeTest.php index 1e7a218..da32360 100644 --- a/tests/Query/Functions/Mysql/JsonTypeTest.php +++ b/tests/Query/Functions/Mysql/JsonTypeTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonTypeTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonUnquoteTest.php b/tests/Query/Functions/Mysql/JsonUnquoteTest.php index 68c9194..9197b75 100644 --- a/tests/Query/Functions/Mysql/JsonUnquoteTest.php +++ b/tests/Query/Functions/Mysql/JsonUnquoteTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonUnquoteTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Mysql/JsonValidTest.php b/tests/Query/Functions/Mysql/JsonValidTest.php index d7ac89d..d86dde7 100644 --- a/tests/Query/Functions/Mysql/JsonValidTest.php +++ b/tests/Query/Functions/Mysql/JsonValidTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; -use Doctrine\ORM\Query\Expr; class JsonValidTest extends MysqlTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonArrayLengthTest.php b/tests/Query/Functions/Sqlite/JsonArrayLengthTest.php index c3c867e..816b867 100644 --- a/tests/Query/Functions/Sqlite/JsonArrayLengthTest.php +++ b/tests/Query/Functions/Sqlite/JsonArrayLengthTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonArrayLengthTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonArrayTest.php b/tests/Query/Functions/Sqlite/JsonArrayTest.php index 0fdc7ef..a285c3a 100644 --- a/tests/Query/Functions/Sqlite/JsonArrayTest.php +++ b/tests/Query/Functions/Sqlite/JsonArrayTest.php @@ -2,8 +2,8 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; -use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; use Doctrine\ORM\Query\Expr; +use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; class JsonArrayTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonExtractTest.php b/tests/Query/Functions/Sqlite/JsonExtractTest.php index 5d99d1f..ec4a1fa 100644 --- a/tests/Query/Functions/Sqlite/JsonExtractTest.php +++ b/tests/Query/Functions/Sqlite/JsonExtractTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonExtractTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonGroupArrayTest.php b/tests/Query/Functions/Sqlite/JsonGroupArrayTest.php index 71e077d..32dadcf 100644 --- a/tests/Query/Functions/Sqlite/JsonGroupArrayTest.php +++ b/tests/Query/Functions/Sqlite/JsonGroupArrayTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonGroupArrayTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonInsertTest.php b/tests/Query/Functions/Sqlite/JsonInsertTest.php index 11576e5..e8425a9 100644 --- a/tests/Query/Functions/Sqlite/JsonInsertTest.php +++ b/tests/Query/Functions/Sqlite/JsonInsertTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonInsertTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonObjectTest.php b/tests/Query/Functions/Sqlite/JsonObjectTest.php index 317dd91..2d1a949 100644 --- a/tests/Query/Functions/Sqlite/JsonObjectTest.php +++ b/tests/Query/Functions/Sqlite/JsonObjectTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonObjectTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonPatchTest.php b/tests/Query/Functions/Sqlite/JsonPatchTest.php index 282802a..2f6f88a 100644 --- a/tests/Query/Functions/Sqlite/JsonPatchTest.php +++ b/tests/Query/Functions/Sqlite/JsonPatchTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonPatchTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonQuoteTest.php b/tests/Query/Functions/Sqlite/JsonQuoteTest.php index d9eadc5..775ceda 100644 --- a/tests/Query/Functions/Sqlite/JsonQuoteTest.php +++ b/tests/Query/Functions/Sqlite/JsonQuoteTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonQuoteTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonRemoveTest.php b/tests/Query/Functions/Sqlite/JsonRemoveTest.php index b31d190..c852eb0 100644 --- a/tests/Query/Functions/Sqlite/JsonRemoveTest.php +++ b/tests/Query/Functions/Sqlite/JsonRemoveTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonRemoveTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonReplaceTest.php b/tests/Query/Functions/Sqlite/JsonReplaceTest.php index 6a94df8..88e27df 100644 --- a/tests/Query/Functions/Sqlite/JsonReplaceTest.php +++ b/tests/Query/Functions/Sqlite/JsonReplaceTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonReplaceTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonSetTest.php b/tests/Query/Functions/Sqlite/JsonSetTest.php index eb92f7f..be75695 100644 --- a/tests/Query/Functions/Sqlite/JsonSetTest.php +++ b/tests/Query/Functions/Sqlite/JsonSetTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonSetTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonTest.php b/tests/Query/Functions/Sqlite/JsonTest.php index b0abf5f..be8c5d3 100644 --- a/tests/Query/Functions/Sqlite/JsonTest.php +++ b/tests/Query/Functions/Sqlite/JsonTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonTypeTest.php b/tests/Query/Functions/Sqlite/JsonTypeTest.php index 80a5b06..500f3ec 100644 --- a/tests/Query/Functions/Sqlite/JsonTypeTest.php +++ b/tests/Query/Functions/Sqlite/JsonTypeTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonTypeTest extends SqliteTestCase { diff --git a/tests/Query/Functions/Sqlite/JsonValidTest.php b/tests/Query/Functions/Sqlite/JsonValidTest.php index 4577ae8..bd01cea 100644 --- a/tests/Query/Functions/Sqlite/JsonValidTest.php +++ b/tests/Query/Functions/Sqlite/JsonValidTest.php @@ -3,7 +3,6 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Sqlite; use Scienta\DoctrineJsonFunctions\Tests\Query\SqliteTestCase; -use Doctrine\ORM\Query\Expr; class JsonValidTest extends SqliteTestCase { diff --git a/tests/Query/MariadbTestCase.php b/tests/Query/MariadbTestCase.php index e9849ec..2ecad71 100644 --- a/tests/Query/MariadbTestCase.php +++ b/tests/Query/MariadbTestCase.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query; -use Doctrine\DBAL\Platforms\MySqlPlatform; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\ORM\Configuration; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb as DqlFunctions; use Scienta\DoctrineJsonFunctions\Tests\Mocks\ConnectionMock; @@ -15,7 +15,7 @@ public function setUp(): void /** @var ConnectionMock $conn */ $conn = $this->entityManager->getConnection(); - $conn->setDatabasePlatform(new MySqlPlatform()); + $conn->setDatabasePlatform(new MySQLPlatform()); self::loadDqlFunctions($this->configuration); } diff --git a/tests/Query/MysqlTestCase.php b/tests/Query/MysqlTestCase.php index 1e06214..b3dcefd 100644 --- a/tests/Query/MysqlTestCase.php +++ b/tests/Query/MysqlTestCase.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query; -use Doctrine\DBAL\Platforms\MySqlPlatform; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\ORM\Configuration; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql as DqlFunctions; use Scienta\DoctrineJsonFunctions\Tests\Mocks\ConnectionMock; @@ -15,7 +15,7 @@ public function setUp(): void /** @var ConnectionMock $conn */ $conn = $this->entityManager->getConnection(); - $conn->setDatabasePlatform(new MySqlPlatform()); + $conn->setDatabasePlatform(new MySQLPlatform()); self::loadDqlFunctions($this->configuration); } diff --git a/tests/Query/PostgresqlTestCase.php b/tests/Query/PostgresqlTestCase.php index 2751cd9..3e78845 100644 --- a/tests/Query/PostgresqlTestCase.php +++ b/tests/Query/PostgresqlTestCase.php @@ -2,7 +2,7 @@ namespace Scienta\DoctrineJsonFunctions\Tests\Query; -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; +use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use Doctrine\ORM\Configuration; use Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql as DqlFunctions; use Scienta\DoctrineJsonFunctions\Tests\Mocks\ConnectionMock; @@ -15,7 +15,7 @@ public function setUp(): void /** @var ConnectionMock $conn */ $conn = $this->entityManager->getConnection(); - $conn->setDatabasePlatform(new PostgreSqlPlatform()); + $conn->setDatabasePlatform(new PostgreSQL94Platform()); self::loadDqlFunctions($this->configuration); }