diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 54e2627460b..13c3a25f75a 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -21,7 +21,7 @@ before_commands: tools: external_code_coverage: timeout: 3600 - runs: 26 # 21x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP + runs: 28 # 23x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP filter: excluded_paths: diff --git a/.travis.yml b/.travis.yml index 60233b12948..44f3daa29a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,11 @@ before_install: fi before_script: - - if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == *"mariadb"* ]]; then mysql < tests/travis/create-mysql-schema.sql; fi; + - | + if [[ -n "$IMAGE" ]] + then + bash ./tests/travis/docker-run-mysql-or-mariadb.sh + fi install: - | @@ -57,155 +61,73 @@ jobs: - stage: Test php: 7.3 - env: DB=mysql.docker MYSQL_VERSION=8.0 - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + env: DB=mysql.docker IMAGE=mysql:5.7 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mysqli.docker MYSQL_VERSION=8.0 - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + env: DB=mysql.docker IMAGE=mysql:8.0 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + env: DB=mysqli.docker IMAGE=mysql:5.7 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb.mysqli MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + env: DB=mysqli.docker IMAGE=mysql:8.0 COVERAGE=yes - stage: Test php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=11.0 - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-postgres-11.sh + env: DB=mariadb.docker IMAGE=mariadb:10.0 COVERAGE=yes - stage: Test php: 7.3 - env: DB=sqlite + env: DB=mariadb.docker IMAGE=mariadb:10.1 COVERAGE=yes - stage: Test php: 7.3 - env: DB=sqlsrv - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-sqlsrv-dependencies.sh - - bash ./tests/travis/install-mssql-sqlsrv.sh - - bash ./tests/travis/install-mssql.sh + env: DB=mariadb.docker IMAGE=mariadb:10.2 COVERAGE=yes - stage: Test php: 7.3 - env: DB=pdo_sqlsrv - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-sqlsrv-dependencies.sh - - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh - - bash ./tests/travis/install-mssql.sh + env: DB=mariadb.docker IMAGE=mariadb:10.3 COVERAGE=yes - stage: Test php: 7.3 - env: DB=sqlite DEPENDENCIES=low - install: - - travis_retry composer update --prefer-dist --prefer-lowest - - stage: Test - php: 7.4 - env: DB=mysql COVERAGE=yes - services: - - mysql - - stage: Test - php: 7.4 - env: DB=mysql.docker MYSQL_VERSION=5.7 COVERAGE=yes - sudo: required - before_script: - - bash ./tests/travis/install-mysql-5.7.sh - - stage: Test - php: 7.4 - env: DB=mysql.docker MYSQL_VERSION=8.0 COVERAGE=yes - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.0 COVERAGE=yes - stage: Test - php: 7.4 - env: DB=mysqli COVERAGE=yes - services: - - mysql + php: 7.3 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.1 COVERAGE=yes - stage: Test - php: 7.4 - env: DB=mysqli.docker MYSQL_VERSION=5.7 COVERAGE=yes - sudo: required - before_script: - - bash ./tests/travis/install-mysql-5.7.sh + php: 7.3 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.2 COVERAGE=yes - stage: Test - php: 7.4 - env: DB=mysqli.docker MYSQL_VERSION=8.0 COVERAGE=yes - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + php: 7.3 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 COVERAGE=yes - stage: Test - php: 7.4 - env: DB=mariadb.docker MARIADB_VERSION=10.1 COVERAGE=yes + dist: trusty + php: 7.3 + env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes services: - - docker - before_script: - - bash ./tests/travis/install-mariadb.sh - - stage: Test - php: 7.4 - env: DB=mariadb MARIADB_VERSION=10.2 COVERAGE=yes + - postgresql addons: - mariadb: 10.2 + postgresql: "9.2" - stage: Test - php: 7.4 - env: DB=mariadb MARIADB_VERSION=10.3 COVERAGE=yes - addons: - mariadb: 10.3 - - stage: Test - php: 7.4 - env: DB=mariadb.mysqli.docker MARIADB_VERSION=10.1 COVERAGE=yes + dist: trusty + php: 7.3 + env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes services: - - docker - before_script: - - bash ./tests/travis/install-mariadb.sh - - stage: Test - php: 7.4 - env: DB=mariadb.mysqli MARIADB_VERSION=10.2 COVERAGE=yes + - postgresql addons: - mariadb: 10.2 + postgresql: "9.3" - stage: Test - php: 7.4 - env: DB=mariadb.mysqli MARIADB_VERSION=10.3 COVERAGE=yes - addons: - mariadb: 10.3 - - stage: Test - php: 7.4 + php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes addons: postgresql: "9.4" - stage: Test - php: 7.4 + php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes addons: postgresql: "9.5" - stage: Test - php: 7.4 + php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes addons: postgresql: "9.6" - stage: Test - php: 7.4 + php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes sudo: required addons: @@ -213,74 +135,93 @@ jobs: before_script: - bash ./tests/travis/install-postgres-10.sh - stage: Test - php: 7.4 + php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=11.0 COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-postgres-11.sh - stage: Test - php: 7.4 + php: 7.3 env: DB=sqlsrv COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-sqlsrv.sh - bash ./tests/travis/install-mssql.sh - stage: Test - php: 7.4 + php: 7.3 env: DB=pdo_sqlsrv COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh - bash ./tests/travis/install-mssql.sh - stage: Test - php: 7.4 + php: 7.3 env: DB=ibm_db2 COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-db2.sh - bash ./tests/travis/install-db2-ibm_db2.sh - stage: Test - php: nightly - env: DB=mysql.docker MYSQL_VERSION=8.0 + php: 7.3 + env: DB=sqlite DEPENDENCIES=low + install: + - travis_retry composer update --prefer-dist --prefer-lowest + - stage: Test + php: 7.4 + env: DB=mysql.docker IMAGE=mysql:8.0 + - stage: Test + php: 7.4 + env: DB=mysqli.docker IMAGE=mysql:8.0 + - stage: Test + php: 7.4 + env: DB=mariadb.docker IMAGE=mariadb:10.3 + - stage: Test + php: 7.4 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 + - stage: Test + php: 7.4 + env: DB=pgsql POSTGRESQL_VERSION=11.0 sudo: required - services: - - docker before_script: - - bash ./tests/travis/install-mysql-8.0.sh + - bash ./tests/travis/install-postgres-11.sh - stage: Test - php: nightly - env: DB=mysqli.docker MYSQL_VERSION=8.0 + php: 7.4 + env: DB=sqlite + - stage: Test + php: 7.4 + env: DB=sqlsrv + sudo: required + before_script: + - bash ./tests/travis/install-sqlsrv-dependencies.sh + - bash ./tests/travis/install-mssql-sqlsrv.sh + - bash ./tests/travis/install-mssql.sh + - stage: Test + php: 7.4 + env: DB=pdo_sqlsrv sudo: required - services: - - docker before_script: - - bash ./tests/travis/install-mysql-8.0.sh + - bash ./tests/travis/install-sqlsrv-dependencies.sh + - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh + - bash ./tests/travis/install-mssql.sh + - stage: Test php: nightly - env: DB=mariadb MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + env: DB=mysql.docker IMAGE=mysql:8.0 - stage: Test php: nightly - env: DB=mariadb.mysqli MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + env: DB=mysqli.docker IMAGE=mysql:8.0 + - stage: Test + php: nightly + env: DB=mariadb.docker IMAGE=mariadb:10.3 + - stage: Test + php: nightly + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 - stage: Test php: nightly env: DB=pgsql POSTGRESQL_VERSION=11.0 sudo: required - services: - - docker before_script: - bash ./tests/travis/install-postgres-11.sh - stage: Test @@ -290,8 +231,6 @@ jobs: php: nightly env: DB=sqlsrv sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-sqlsrv.sh @@ -300,8 +239,6 @@ jobs: php: nightly env: DB=pdo_sqlsrv sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh diff --git a/README.md b/README.md index 7495d20d7ee..37ffcad5734 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Doctrine DBAL -| [Master][Master] | [2.9][2.9] | [Develop][develop] | -|:----------------:|:----------:|:------------------:| -| [![Build status][Master image]][Master] | [![Build status][2.9 image]][2.9] | [![Build status][develop image]][develop] | -| [![Build Status][ContinuousPHP image]][ContinuousPHP] | [![Build Status][ContinuousPHP 2.9 image]][ContinuousPHP] | [![Build Status][ContinuousPHP develop image]][ContinuousPHP] | -| [![Code Coverage][Coverage image]][Scrutinizer Master] | [![Code Coverage][Coverage 2.9 image]][Scrutinizer 2.9] | [![Code Coverage][Coverage develop image]][Scrutinizer develop] | -| [![Code Quality][Quality image]][Scrutinizer Master] | [![Code Quality][Quality 2.9 image]][Scrutinizer 2.9] | [![Code Quality][Quality develop image]][Scrutinizer develop] | -| [![AppVeyor][AppVeyor master image]][AppVeyor master] | [![AppVeyor][AppVeyor 2.9 image]][AppVeyor 2.9] | [![AppVeyor][AppVeyor develop image]][AppVeyor develop] | +| [Master][Master] | [2.10][2.10] | +|:----------------:|:----------:| +| [![Build status][Master image]][Master] | [![Build status][2.10 image]][2.10] | +| [![Build Status][ContinuousPHP image]][ContinuousPHP] | [![Build Status][ContinuousPHP 2.10 image]][ContinuousPHP] | +| [![Code Coverage][Coverage image]][Scrutinizer Master] | [![Code Coverage][Coverage 2.10 image]][Scrutinizer 2.10] | +| [![Code Quality][Quality image]][Scrutinizer Master] | [![Code Quality][Quality 2.10 image]][Scrutinizer 2.10] | +| [![AppVeyor][AppVeyor master image]][AppVeyor master] | [![AppVeyor][AppVeyor 2.10 image]][AppVeyor 2.10] | Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction. @@ -26,21 +26,11 @@ Powerful database abstraction layer with many features for database schema intro [AppVeyor master image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/master?svg=true [ContinuousPHP]: https://continuousphp.com/git-hub/doctrine/dbal - [2.9 image]: https://img.shields.io/travis/doctrine/dbal/2.9.svg?style=flat-square - [Coverage 2.9 image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/2.9.svg?style=flat-square - [Quality 2.9 image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/2.9.svg?style=flat-square - [ContinuousPHP 2.9 image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/2.9.svg?style=flat-square - [2.9]: https://github.com/doctrine/dbal/tree/2.9 - [Scrutinizer 2.9]: https://scrutinizer-ci.com/g/doctrine/dbal/?branch=2.9 - [AppVeyor 2.9]: https://ci.appveyor.com/project/doctrine/dbal/branch/2.9 - [AppVeyor 2.9 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/2.9?svg=true - - [develop]: https://github.com/doctrine/dbal/tree/develop - [develop image]: https://img.shields.io/travis/doctrine/dbal/develop.svg?style=flat-square - [Coverage develop image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/develop.svg?style=flat-square - [Quality develop image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/develop.svg?style=flat-square - [ContinuousPHP develop image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/develop.svg?style=flat-square - [develop]: https://github.com/doctrine/dbal/tree/develop - [Scrutinizer develop]: https://scrutinizer-ci.com/g/doctrine/dbal/?branch=develop - [AppVeyor develop]: https://ci.appveyor.com/project/doctrine/dbal/branch/develop - [AppVeyor develop image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/develop?svg=true + [2.10 image]: https://img.shields.io/travis/doctrine/dbal/2.10.x.svg?style=flat-square + [Coverage 2.10 image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/2.10.x.svg?style=flat-square + [Quality 2.10 image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/2.10.x.svg?style=flat-square + [ContinuousPHP 2.10 image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/2.10.x.svg?style=flat-square + [2.10]: https://github.com/doctrine/dbal/tree/2.10.x + [Scrutinizer 2.10]: https://scrutinizer-ci.com/g/doctrine/dbal/?branch=2.10.x + [AppVeyor 2.10]: https://ci.appveyor.com/project/doctrine/dbal/branch/2.10.x + [AppVeyor 2.10 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/2.10.x?svg=true diff --git a/docs/en/reference/sharding.rst b/docs/en/reference/sharding.rst index dcdd7d8f660..2b2f804da53 100644 --- a/docs/en/reference/sharding.rst +++ b/docs/en/reference/sharding.rst @@ -160,7 +160,7 @@ following code in Doctrine: use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Id\TableGenerator; - $conn = DriverManager::getConnection(/**..**); // connection 1 + $conn = DriverManager::getConnection(/**..**/); // connection 1 // creating the TableGenerator automatically opens a second connection. $tableGenerator = new TableGenerator($conn, "sequences_tbl_name"); diff --git a/lib/Doctrine/DBAL/DriverManager.php b/lib/Doctrine/DBAL/DriverManager.php index 1872a2e57a0..d1e89372f6e 100644 --- a/lib/Doctrine/DBAL/DriverManager.php +++ b/lib/Doctrine/DBAL/DriverManager.php @@ -87,20 +87,7 @@ private function __construct() * * $params must contain at least one of the following. * - * Either 'driver' with one of the following values: - * - * pdo_mysql - * pdo_sqlite - * pdo_pgsql - * pdo_oci (unstable) - * pdo_sqlsrv - * pdo_sqlsrv - * mysqli - * sqlanywhere - * sqlsrv - * ibm_db2 (unstable) - * drizzle_pdo_mysql - * + * Either 'driver' with one of the array keys of {@link $_driverMap}, * OR 'driverClass' that contains the full class name (with namespace) of the * driver class to instantiate. * diff --git a/lib/Doctrine/DBAL/Logging/DebugStack.php b/lib/Doctrine/DBAL/Logging/DebugStack.php index e1ccaad6ba0..1895dde5381 100644 --- a/lib/Doctrine/DBAL/Logging/DebugStack.php +++ b/lib/Doctrine/DBAL/Logging/DebugStack.php @@ -12,7 +12,7 @@ class DebugStack implements SQLLogger /** * Executed SQL queries. * - * @var mixed[][] + * @var array> */ public $queries = []; diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index e570dc04ab0..dd90f2cb6b3 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -367,7 +367,7 @@ private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias [$schema, $table] = explode('.', $table); $schema = $this->quoteStringLiteral($schema); } else { - $schema = "ANY(string_to_array((select replace(replace(setting,'\"\$user\"',user),' ','') from pg_catalog.pg_settings where name = 'search_path'),','))"; + $schema = 'ANY(current_schemas(false))'; } $table = new Identifier($table); diff --git a/lib/Doctrine/DBAL/Query/QueryBuilder.php b/lib/Doctrine/DBAL/Query/QueryBuilder.php index d7b70a5d4ef..b33fce72689 100644 --- a/lib/Doctrine/DBAL/Query/QueryBuilder.php +++ b/lib/Doctrine/DBAL/Query/QueryBuilder.php @@ -3,7 +3,7 @@ namespace Doctrine\DBAL\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\Statement; +use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Query\Expression\CompositeExpression; use Doctrine\DBAL\Query\Expression\ExpressionBuilder; @@ -118,9 +118,9 @@ class QueryBuilder private $firstResult = null; /** - * The maximum number of results to retrieve. + * The maximum number of results to retrieve or NULL to retrieve all results. * - * @var int + * @var int|null */ private $maxResults = null; @@ -198,7 +198,7 @@ public function getState() * Uses {@see Connection::executeQuery} for select statements and {@see Connection::executeUpdate} * for insert, update and delete statements. * - * @return Statement|int + * @return ResultStatement|int */ public function execute() { @@ -367,7 +367,6 @@ public function setFirstResult($firstResult) /** * Gets the position of the first result the query object was set to retrieve (the "offset"). - * Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder. * * @return int The position of the first result. */ @@ -379,7 +378,7 @@ public function getFirstResult() /** * Sets the maximum number of results to retrieve (the "limit"). * - * @param int $maxResults The maximum number of results to retrieve. + * @param int|null $maxResults The maximum number of results to retrieve or NULL to retrieve all results. * * @return $this This QueryBuilder instance. */ @@ -393,7 +392,7 @@ public function setMaxResults($maxResults) /** * Gets the maximum number of results the query object was set to retrieve (the "limit"). - * Returns NULL if {@link setMaxResults} was not applied to this query builder. + * Returns NULL if all results will be returned. * * @return int The maximum number of results. */ @@ -1339,9 +1338,11 @@ private function getSQLForJoins($fromAlias, array &$knownAliases) if (array_key_exists($join['joinAlias'], $knownAliases)) { throw QueryException::nonUniqueAlias($join['joinAlias'], array_keys($knownAliases)); } - $sql .= ' ' . strtoupper($join['joinType']) - . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias'] - . ' ON ' . ((string) $join['joinCondition']); + $sql .= ' ' . strtoupper($join['joinType']) + . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias']; + if ($join['joinCondition'] !== null) { + $sql .= ' ON ' . $join['joinCondition']; + } $knownAliases[$join['joinAlias']] = true; } diff --git a/lib/Doctrine/DBAL/SQLParserUtils.php b/lib/Doctrine/DBAL/SQLParserUtils.php index 9768883846e..6329a84e20d 100644 --- a/lib/Doctrine/DBAL/SQLParserUtils.php +++ b/lib/Doctrine/DBAL/SQLParserUtils.php @@ -4,7 +4,9 @@ use const PREG_OFFSET_CAPTURE; use function array_fill; +use function array_fill_keys; use function array_key_exists; +use function array_keys; use function array_merge; use function array_slice; use function array_values; @@ -31,9 +33,9 @@ class SQLParserUtils public const POSITIONAL_TOKEN = '\?'; public const NAMED_TOKEN = '(? 32 ? substr($value, 0, 20) . '...' : $value; - return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType); + return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType, 0, $previous); } /** @@ -64,8 +64,12 @@ public static function conversionFailedFormat($value, $toType, $expectedFormat, * * @return \Doctrine\DBAL\Types\ConversionException */ - public static function conversionFailedInvalidType($value, $toType, array $possibleTypes) - { + public static function conversionFailedInvalidType( + $value, + $toType, + array $possibleTypes, + ?Throwable $previous = null + ) { $actualType = is_object($value) ? get_class($value) : gettype($value); if (is_scalar($value)) { @@ -75,7 +79,7 @@ public static function conversionFailedInvalidType($value, $toType, array $possi $actualType, $toType, implode(', ', $possibleTypes) - )); + ), 0, $previous); } return new self(sprintf( @@ -83,7 +87,7 @@ public static function conversionFailedInvalidType($value, $toType, array $possi $actualType, $toType, implode(', ', $possibleTypes) - )); + ), 0, $previous); } public static function conversionFailedSerialization($value, $format, $error) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a9523aac100..5b597ae2e9d 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -19,7 +19,6 @@ parameters: - "~^Casting to bool something that's already bool.~" - "~^Casting to int something that's already int.~" - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\DB2Connection::exec\(\) should return int but returns bool\.\z~' - - '~^Method Doctrine\\DBAL\\Query\\QueryBuilder::execute\(\) should return Doctrine\\DBAL\\Driver\\Statement\|int but returns Doctrine\\DBAL\\Driver\\ResultStatement\.\z~' - '~^Property Doctrine\\DBAL\\Schema\\Table::\$_primaryKeyName \(string\) does not accept (default value of type )?false\.\z~' - '~^Property Doctrine\\DBAL\\Schema\\Schema::\$_schemaConfig \(Doctrine\\DBAL\\Schema\\SchemaConfig\) does not accept default value of type false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\ForeignKeyConstraint::onEvent\(\) should return string\|null but returns false\.\z~' diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php index 35326968798..b8a26af3c65 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php @@ -335,6 +335,18 @@ public function testListQuotedTable() : void self::assertFalse($comparator->diffTable($offlineTable, $onlineTable)); } + public function testListTableDetailsWhenCurrentSchemaNameQuoted() : void + { + $this->connection->exec('CREATE SCHEMA "001_test"'); + $this->connection->exec('SET search_path TO "001_test"'); + + try { + $this->testListQuotedTable(); + } finally { + $this->connection->close(); + } + } + public function testListTablesExcludesViews() : void { $this->createTestTable('list_tables_excludes_views'); diff --git a/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php b/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php index 7397ee34296..0c0c2ceae0a 100644 --- a/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php +++ b/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php @@ -92,11 +92,22 @@ public function testSelectWithJoin() : void $qb->select('u.*', 'p.*') ->from('users', 'u') - ->Join('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); + ->join('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); self::assertEquals('SELECT u.*, p.* FROM users u INNER JOIN phones p ON p.user_id = u.id', (string) $qb); } + public function testSelectWithJoinNoCondition() : void + { + $qb = new QueryBuilder($this->conn); + + $qb->select('u.*', 'p.*') + ->from('users', 'u') + ->join('u', 'phones', 'p'); + + self::assertEquals('SELECT u.*, p.* FROM users u INNER JOIN phones p', (string) $qb); + } + public function testSelectWithInnerJoin() : void { $qb = new QueryBuilder($this->conn); @@ -569,13 +580,27 @@ public function testGetState() : void self::assertEquals($sql1, $qb->getSQL()); } - public function testSetMaxResults() : void + /** + * @dataProvider maxResultsProvider + */ + public function testSetMaxResults(?int $maxResults) : void { $qb = new QueryBuilder($this->conn); - $qb->setMaxResults(10); + $qb->setMaxResults($maxResults); self::assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState()); - self::assertEquals(10, $qb->getMaxResults()); + self::assertEquals($maxResults, $qb->getMaxResults()); + } + + /** + * @return mixed[][] + */ + public static function maxResultsProvider() : iterable + { + return [ + 'non-null' => [10], + 'null' => [null], + ]; } public function testSetFirstResult() : void diff --git a/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php b/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php index ea8d4dc0752..a582a272dd1 100644 --- a/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php +++ b/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php @@ -89,7 +89,7 @@ public static function dataGetPlaceholderPositions() : iterable ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE "\\\\") AND (data.description LIKE :condition_1 ESCAPE \'\\\\\') ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE `\\\\`) AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE \'\\\\\') AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], - + ["SELECT * FROM Foo WHERE (foo.bar LIKE :condition_0 ESCAPE '\') AND (foo.baz = :condition_1) AND (foo.bak LIKE :condition_2 ESCAPE '\')", false, [38 => 'condition_0', 78 => 'condition_1', 110 => 'condition_2']], ]; } @@ -110,8 +110,7 @@ public function testGetPlaceholderPositions(string $query, bool $isPositional, a public static function dataExpandListParameters() : iterable { return [ - // Positional: Very simple with one needle - [ + 'Positional: Very simple with one needle' => [ 'SELECT * FROM Foo WHERE foo IN (?)', [[1, 2, 3]], [Connection::PARAM_INT_ARRAY], @@ -119,8 +118,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 3], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Positional: One non-list before d one after list-needle - [ + 'Positional: One non-list before d one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?)', ['string', [1, 2, 3]], [ParameterType::STRING, Connection::PARAM_INT_ARRAY], @@ -128,8 +126,7 @@ public static function dataExpandListParameters() : iterable ['string', 1, 2, 3], [ParameterType::STRING, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Positional: One non-list after list-needle - [ + 'Positional: One non-list after list-needle' => [ 'SELECT * FROM Foo WHERE bar IN (?) AND baz = ?', [[1, 2, 3], 'foo'], [Connection::PARAM_INT_ARRAY, ParameterType::STRING], @@ -137,8 +134,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 3, 'foo'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // Positional: One non-list before and one after list-needle - [ + 'Positional: One non-list before and one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?) AND baz = ?', [1, [1, 2, 3], 4], [ParameterType::INTEGER, Connection::PARAM_INT_ARRAY, ParameterType::INTEGER], @@ -152,8 +148,7 @@ public static function dataExpandListParameters() : iterable ParameterType::INTEGER, ], ], - // Positional: Two lists - [ + 'Positional: Two lists' => [ 'SELECT * FROM Foo WHERE foo IN (?, ?)', [[1, 2, 3], [4, 5]], [Connection::PARAM_INT_ARRAY, Connection::PARAM_INT_ARRAY], @@ -167,8 +162,7 @@ public static function dataExpandListParameters() : iterable ParameterType::INTEGER, ], ], - // Positional: Empty "integer" array DDC-1978 - [ + 'Positional: Empty "integer" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (?)', [[]], [Connection::PARAM_INT_ARRAY], @@ -176,8 +170,7 @@ public static function dataExpandListParameters() : iterable [], [], ], - // Positional: Empty "str" array DDC-1978 - [ + 'Positional: Empty "str" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (?)', [[]], [Connection::PARAM_STR_ARRAY], @@ -185,17 +178,15 @@ public static function dataExpandListParameters() : iterable [], [], ], - // Positional: explicit keys for params and types - [ + 'Positional: explicit keys for params and types' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar = ? AND baz = ?', [1 => 'bar', 2 => 'baz', 0 => 1], [2 => ParameterType::STRING, 1 => ParameterType::STRING], 'SELECT * FROM Foo WHERE foo = ? AND bar = ? AND baz = ?', [1 => 'bar', 0 => 1, 2 => 'baz'], - [1 => ParameterType::STRING, 2 => ParameterType::STRING], + [1 => ParameterType::STRING, 2 => ParameterType::STRING, 0 => null], ], - // Positional: explicit keys for array params and array types - [ + 'Positional: explicit keys for array params and array types' => [ 'SELECT * FROM Foo WHERE foo IN (?) AND bar IN (?) AND baz = ?', [1 => ['bar1', 'bar2'], 2 => true, 0 => [1, 2, 3]], [2 => ParameterType::BOOLEAN, 1 => Connection::PARAM_STR_ARRAY, 0 => Connection::PARAM_INT_ARRAY], @@ -210,8 +201,7 @@ public static function dataExpandListParameters() : iterable ParameterType::BOOLEAN, ], ], - // Positional starts from 1: One non-list before and one after list-needle - [ + 'Positional starts from 1: One non-list before and one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?) AND baz = ? AND foo IN (?)', [1 => 1, 2 => [1, 2, 3], 3 => 4, 4 => [5, 6]], [ @@ -232,8 +222,7 @@ public static function dataExpandListParameters() : iterable ParameterType::INTEGER, ], ], - // Named parameters : Very simple with param int - [ + 'Named: Very simple with param int' => [ 'SELECT * FROM Foo WHERE foo = :foo', ['foo' => 1], ['foo' => ParameterType::INTEGER], @@ -241,9 +230,7 @@ public static function dataExpandListParameters() : iterable [1], [ParameterType::INTEGER], ], - - // Named parameters : Very simple with param int and string - [ + 'Named: Very simple with param int and string' => [ 'SELECT * FROM Foo WHERE foo = :foo AND bar = :bar', ['bar' => 'Some String','foo' => 1], ['foo' => ParameterType::INTEGER, 'bar' => ParameterType::STRING], @@ -251,8 +238,7 @@ public static function dataExpandListParameters() : iterable [1,'Some String'], [ParameterType::INTEGER, ParameterType::STRING], ], - // Named parameters : Very simple with one needle - [ + 'Named: Very simple with one needle' => [ 'SELECT * FROM Foo WHERE foo IN (:foo)', ['foo' => [1, 2, 3]], ['foo' => Connection::PARAM_INT_ARRAY], @@ -260,8 +246,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 3], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Named parameters: One non-list before d one after list-needle - [ + 'Named: One non-list before d one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = :foo AND bar IN (:bar)', ['foo' => 'string', 'bar' => [1, 2, 3]], ['foo' => ParameterType::STRING, 'bar' => Connection::PARAM_INT_ARRAY], @@ -269,8 +254,7 @@ public static function dataExpandListParameters() : iterable ['string', 1, 2, 3], [ParameterType::STRING, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Named parameters: One non-list after list-needle - [ + 'Named: One non-list after list-needle' => [ 'SELECT * FROM Foo WHERE bar IN (:bar) AND baz = :baz', ['bar' => [1, 2, 3], 'baz' => 'foo'], ['bar' => Connection::PARAM_INT_ARRAY, 'baz' => ParameterType::STRING], @@ -278,26 +262,39 @@ public static function dataExpandListParameters() : iterable [1, 2, 3, 'foo'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // Named parameters: One non-list before and one after list-needle - [ + 'Named: One non-list before and one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = :foo AND bar IN (:bar) AND baz = :baz', ['bar' => [1, 2, 3],'foo' => 1, 'baz' => 4], - ['bar' => Connection::PARAM_INT_ARRAY, 'foo' => ParameterType::INTEGER, 'baz' => ParameterType::INTEGER], + [ + 'bar' => Connection::PARAM_INT_ARRAY, + 'foo' => ParameterType::INTEGER, + 'baz' => ParameterType::INTEGER, + ], 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?, ?, ?) AND baz = ?', [1, 1, 2, 3, 4], - [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], + [ + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ], ], - // Named parameters: Two lists - [ + 'Named: Two lists' => [ 'SELECT * FROM Foo WHERE foo IN (:a, :b)', ['b' => [4, 5],'a' => [1, 2, 3]], ['a' => Connection::PARAM_INT_ARRAY, 'b' => Connection::PARAM_INT_ARRAY], 'SELECT * FROM Foo WHERE foo IN (?, ?, ?, ?, ?)', [1, 2, 3, 4, 5], - [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], + [ + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ], ], - // Named parameters : With the same name arg type string - [ + 'Named: With the same name arg type string' => [ 'SELECT * FROM Foo WHERE foo <> :arg AND bar = :arg', ['arg' => 'Some String'], ['arg' => ParameterType::STRING], @@ -305,18 +302,22 @@ public static function dataExpandListParameters() : iterable ['Some String','Some String'], [ParameterType::STRING,ParameterType::STRING], ], - // Named parameters : With the same name arg - [ + 'Named: With the same name arg' => [ 'SELECT * FROM Foo WHERE foo IN (:arg) AND NOT bar IN (:arg)', ['arg' => [1, 2, 3]], ['arg' => Connection::PARAM_INT_ARRAY], 'SELECT * FROM Foo WHERE foo IN (?, ?, ?) AND NOT bar IN (?, ?, ?)', [1, 2, 3, 1, 2, 3], - [ParameterType::INTEGER,ParameterType::INTEGER, ParameterType::INTEGER,ParameterType::INTEGER,ParameterType::INTEGER, ParameterType::INTEGER], + [ + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ], ], - - // Named parameters : Same name, other name in between DBAL-299 - [ + 'Named: Same name, other name in between (DBAL-299)' => [ 'SELECT * FROM Foo WHERE (:foo = 2) AND (:bar = 3) AND (:foo = 2)', ['foo' => 2,'bar' => 3], ['foo' => ParameterType::INTEGER,'bar' => ParameterType::INTEGER], @@ -324,8 +325,7 @@ public static function dataExpandListParameters() : iterable [2, 3, 2], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Named parameters : Empty "integer" array DDC-1978 - [ + 'Named: Empty "integer" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (:foo)', ['foo' => []], ['foo' => Connection::PARAM_INT_ARRAY], @@ -333,8 +333,7 @@ public static function dataExpandListParameters() : iterable [], [], ], - // Named parameters : Two empty "str" array DDC-1978 - [ + 'Named: Two empty "str" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (:foo) OR bar IN (:bar)', ['foo' => [], 'bar' => []], ['foo' => Connection::PARAM_STR_ARRAY, 'bar' => Connection::PARAM_STR_ARRAY], @@ -358,8 +357,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 'bar'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // Params/types with colons - [ + 'Params/types with colons' => [ 'SELECT * FROM Foo WHERE foo = :foo OR bar = :bar', [':foo' => 'foo', ':bar' => 'bar'], [':foo' => ParameterType::INTEGER], @@ -391,8 +389,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 'bar'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // DBAL-522 - null valued parameters are not considered - [ + 'Null valued parameters (DBAL-522)' => [ 'INSERT INTO Foo (foo, bar) values (:foo, :bar)', ['foo' => 1, 'bar' => null], [':foo' => ParameterType::INTEGER, ':bar' => ParameterType::NULL], @@ -408,8 +405,7 @@ public static function dataExpandListParameters() : iterable [1, null], [ParameterType::INTEGER, ParameterType::NULL], ], - // DBAL-1205 - Escaped single quotes SQL- and C-Style - [ + 'Escaped single quotes SQL- and C-Style (DBAL-1205)' => [ "SELECT * FROM Foo WHERE foo = :foo||''':not_a_param''\\'' OR bar = ''':not_a_param''\\'':bar", [':foo' => 1, ':bar' => 2], [':foo' => ParameterType::INTEGER, 'bar' => ParameterType::INTEGER], @@ -417,6 +413,14 @@ public static function dataExpandListParameters() : iterable [1, 2], [ParameterType::INTEGER, ParameterType::INTEGER], ], + [ + 'SELECT NULL FROM dummy WHERE ? IN (?)', + ['foo', ['bar', 'baz']], + [1 => Connection::PARAM_STR_ARRAY], + 'SELECT NULL FROM dummy WHERE ? IN (?, ?)', + ['foo', 'bar', 'baz'], + [null, ParameterType::STRING, ParameterType::STRING], + ], ]; } diff --git a/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php b/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php index f0b115ddc4f..5a59088e42a 100644 --- a/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php +++ b/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php @@ -4,6 +4,7 @@ use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\Index; +use Doctrine\DBAL\Schema\Table; use PHPUnit\Framework\TestCase; class ForeignKeyConstraintTest extends TestCase @@ -56,4 +57,30 @@ public static function getIntersectsIndexColumnsData() : iterable [['FOO'], true], ]; } + + /** + * @param string|Table $foreignTableName + * + * @group DBAL-1062 + * @dataProvider getUnqualifiedForeignTableNameData + */ + public function testGetUnqualifiedForeignTableName($foreignTableName, string $expectedUnqualifiedTableName) : void + { + $foreignKey = new ForeignKeyConstraint(['foo', 'bar'], $foreignTableName, ['fk_foo', 'fk_bar']); + + self::assertSame($expectedUnqualifiedTableName, $foreignKey->getUnqualifiedForeignTableName()); + } + + /** + * @return mixed[][] + */ + public static function getUnqualifiedForeignTableNameData() : iterable + { + return [ + ['schema.foreign_table', 'foreign_table'], + ['foreign_table', 'foreign_table'], + [new Table('schema.foreign_table'), 'foreign_table'], + [new Table('foreign_table'), 'foreign_table'], + ]; + } } diff --git a/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php b/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php index e7fa8a4be03..f8003c5c617 100644 --- a/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php @@ -3,13 +3,23 @@ namespace Doctrine\Tests\DBAL\Types; use Doctrine\DBAL\Types\ConversionException; -use Exception; use PHPUnit\Framework\TestCase; use stdClass; +use Throwable; use function tmpfile; class ConversionExceptionTest extends TestCase { + public function testConversionFailedPreviousException() : void + { + $previous = $this->createMock(Throwable::class); + + $exception = ConversionException::conversionFailed('foo', 'foo', $previous); + + self::assertInstanceOf(ConversionException::class, $exception); + self::assertSame($previous, $exception->getPrevious()); + } + /** * @param mixed $scalarValue * @@ -44,9 +54,19 @@ public function testConversionFailedInvalidTypeWithNonScalar($nonScalar) : void ); } + public function testConversionFailedInvalidTypePreviousException() : void + { + $previous = $this->createMock(Throwable::class); + + $exception = ConversionException::conversionFailedInvalidType('foo', 'foo', ['bar', 'baz'], $previous); + + self::assertInstanceOf(ConversionException::class, $exception); + self::assertSame($previous, $exception->getPrevious()); + } + public function testConversionFailedFormatPreservesPreviousException() : void { - $previous = new Exception(); + $previous = $this->createMock(Throwable::class); $exception = ConversionException::conversionFailedFormat('foo', 'bar', 'baz', $previous); diff --git a/tests/travis/create-mysql-schema.sql b/tests/travis/create-mysql-schema.sql deleted file mode 100644 index 78a32358065..00000000000 --- a/tests/travis/create-mysql-schema.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP USER IF EXISTS 'travis'@'%'; -CREATE USER 'travis'@'%'; - -CREATE SCHEMA doctrine_tests; -CREATE SCHEMA test_create_database; -CREATE SCHEMA test_drop_database; - -GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'; -GRANT ALL PRIVILEGES ON test_create_database.* to travis@'%'; -GRANT ALL PRIVILEGES ON test_drop_database.* to travis@'%'; diff --git a/tests/travis/docker-run-mysql-or-mariadb.sh b/tests/travis/docker-run-mysql-or-mariadb.sh new file mode 100644 index 00000000000..a78ce4adb6e --- /dev/null +++ b/tests/travis/docker-run-mysql-or-mariadb.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +set -ex + +echo "Starting RDBMS…">&2 + +if [[ "$IMAGE" == "mysql:8.0" ]] +then + CMD_OPTIONS="--default-authentication-plugin=mysql_native_password" +else + CMD_OPTIONS="" +fi + +docker run \ + --health-cmd='mysqladmin ping --silent' \ + --detach \ + --env MYSQL_ALLOW_EMPTY_PASSWORD=yes \ + --env MYSQL_DATABASE=doctrine_tests \ + --publish 33306:3306 \ + --name rdbms \ + "$IMAGE" $CMD_OPTIONS + +while true; do + healthStatus=$(docker inspect --format "{{json .State.Health.Status }}" rdbms) + case $healthStatus in + '"starting"') + echo "Waiting for RDBMS to become ready…">&2 + sleep 1 + ;; + '"healthy"') + echo "Container is healthy">&2 + break + ;; + '"unhealthy"') + echo "Container is unhealthy">&2 + exit 1 + ;; + *) + echo "Unexpected health status $healthStatus">&2 + ;; + esac +done diff --git a/tests/travis/install-mysql-5.7.sh b/tests/travis/install-mysql-5.7.sh deleted file mode 100644 index 25459382c6f..00000000000 --- a/tests/travis/install-mysql-5.7.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Starting MySQL 5.7..." - -sudo docker run \ - -d \ - -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ - -e MYSQL_DATABASE=doctrine_tests \ - -p 33306:3306 \ - --name mysql57 \ - mysql:5.7 - -sudo docker exec -i mysql57 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done' diff --git a/tests/travis/install-mysql-8.0.sh b/tests/travis/install-mysql-8.0.sh deleted file mode 100644 index 952a4300ba7..00000000000 --- a/tests/travis/install-mysql-8.0.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Starting MySQL 8.0..." - -sudo docker pull mysql:8.0 -sudo docker run \ - -d \ - -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ - -e MYSQL_DATABASE=doctrine_tests \ - -p 33306:3306 \ - --name mysql80 \ - mysql:8.0 \ - --default-authentication-plugin=mysql_native_password - -sudo docker exec -i mysql80 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done' diff --git a/tests/travis/mariadb.mysqli.travis.xml b/tests/travis/mariadb.mysqli.travis.xml deleted file mode 100644 index b8bd9be01cd..00000000000 --- a/tests/travis/mariadb.mysqli.travis.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - - - - - performance - locking_functional - - - diff --git a/tests/travis/mariadb.travis.xml b/tests/travis/mariadb.travis.xml deleted file mode 100644 index 0d4e2c43c9e..00000000000 --- a/tests/travis/mariadb.travis.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - - - - - performance - locking_functional - - - diff --git a/tests/travis/mysql.travis.xml b/tests/travis/mysql.travis.xml deleted file mode 100644 index 0d4e2c43c9e..00000000000 --- a/tests/travis/mysql.travis.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - - - - - performance - locking_functional - - - diff --git a/tests/travis/mysqli.travis.xml b/tests/travis/mysqli.travis.xml deleted file mode 100644 index b8bd9be01cd..00000000000 --- a/tests/travis/mysqli.travis.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - - - - - performance - locking_functional - - -