diff --git a/.scrutinizer.yml b/.scrutinizer.yml index a3b8a5621ca..c8831b78bcb 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -21,7 +21,7 @@ before_commands: tools: external_code_coverage: timeout: 3600 - runs: 30 # 25x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP + runs: 26 # 21x 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 cac4d984d59..392659b0858 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,27 @@ language: php -sudo: false -dist: trusty +dist: bionic cache: - directories: - - vendor - - $HOME/.composer/cache + directories: + - vendor + - $HOME/.composer/cache before_install: - phpenv config-rm xdebug.ini || true - | if [ "x$COVERAGE" == "xyes" ]; then - pecl install pcov-1.0.0 + pecl install pcov-1.0.6 fi before_script: - if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == *"mariadb"* ]]; then mysql < tests/travis/create-mysql-schema.sql; fi; install: - - travis_retry composer -n install --prefer-dist + - | + if [[ $TRAVIS_PHP_VERSION = "nightly" ]]; then + export COMPOSER_FLAGS="--ignore-platform-reqs" + fi + - travis_retry composer -n install --prefer-dist $COMPOSER_FLAGS script: - | @@ -39,15 +42,15 @@ jobs: include: - stage: Smoke Testing - php: 7.3 + php: 7.4 env: DB=sqlite COVERAGE=yes - stage: Smoke Testing - php: 7.3 + php: 7.4 env: PHPStan install: travis_retry composer install --prefer-dist script: vendor/bin/phpstan analyse - stage: Smoke Testing - php: 7.3 + php: 7.4 env: PHP_CodeSniffer install: travis_retry composer install --prefer-dist script: vendor/bin/phpcs @@ -109,17 +112,81 @@ jobs: - 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.2 + env: DB=sqlite DEPENDENCIES=low + install: + - travis_retry composer update --prefer-dist --prefer-lowest - stage: Test php: 7.3 - env: DB=mysql COVERAGE=yes + env: DB=mysql.docker MYSQL_VERSION=8.0 + sudo: required + services: + - docker + before_script: + - bash ./tests/travis/install-mysql-8.0.sh + - 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 + - stage: Test + php: 7.3 + env: DB=mariadb MARIADB_VERSION=10.3 + addons: + mariadb: 10.3 - stage: Test php: 7.3 + env: DB=mariadb.mysqli MARIADB_VERSION=10.3 + addons: + mariadb: 10.3 + - 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 + - stage: Test + php: 7.3 + env: DB=sqlite + - 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 + - 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 + - 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.3 + php: 7.4 env: DB=mysql.docker MYSQL_VERSION=8.0 COVERAGE=yes sudo: required services: @@ -127,16 +194,18 @@ jobs: before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test - php: 7.3 + php: 7.4 env: DB=mysqli COVERAGE=yes + services: + - mysql - stage: Test - php: 7.3 + 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 - stage: Test - php: 7.3 + php: 7.4 env: DB=mysqli.docker MYSQL_VERSION=8.0 COVERAGE=yes sudo: required services: @@ -144,92 +213,64 @@ jobs: before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test - php: 7.3 - env: DB=mariadb MARIADB_VERSION=10.0 COVERAGE=yes - addons: - mariadb: 10.0 - - stage: Test - php: 7.3 - env: DB=mariadb MARIADB_VERSION=10.1 COVERAGE=yes - addons: - mariadb: 10.1 + php: 7.4 + env: DB=mariadb.docker MARIADB_VERSION=10.1 COVERAGE=yes + services: + - docker + before_script: + - bash ./tests/travis/install-mariadb.sh - stage: Test - php: 7.3 + php: 7.4 env: DB=mariadb MARIADB_VERSION=10.2 COVERAGE=yes addons: mariadb: 10.2 - stage: Test - php: 7.3 + php: 7.4 env: DB=mariadb MARIADB_VERSION=10.3 COVERAGE=yes addons: mariadb: 10.3 - stage: Test - php: 7.3 - env: DB=mariadb.mysqli MARIADB_VERSION=10.0 COVERAGE=yes - addons: - mariadb: 10.0 - - stage: Test - php: 7.3 - env: DB=mariadb.mysqli MARIADB_VERSION=10.1 COVERAGE=yes - addons: - mariadb: 10.1 + php: 7.4 + env: DB=mariadb.mysqli.docker MARIADB_VERSION=10.1 COVERAGE=yes + services: + - docker + before_script: + - bash ./tests/travis/install-mariadb.sh - stage: Test - php: 7.3 + php: 7.4 env: DB=mariadb.mysqli MARIADB_VERSION=10.2 COVERAGE=yes addons: mariadb: 10.2 - stage: Test - php: 7.3 + php: 7.4 env: DB=mariadb.mysqli MARIADB_VERSION=10.3 COVERAGE=yes addons: mariadb: 10.3 - stage: Test - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes - services: - - postgresql - addons: - postgresql: "9.2" - - stage: Test - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes - services: - - postgresql - addons: - postgresql: "9.3" - - stage: Test - php: 7.3 + php: 7.4 env: DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes - services: - - postgresql addons: postgresql: "9.4" - stage: Test - php: 7.3 + php: 7.4 env: DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes - services: - - postgresql addons: postgresql: "9.5" - stage: Test - php: 7.3 + php: 7.4 env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes - services: - - postgresql addons: postgresql: "9.6" - stage: Test - php: 7.3 + php: 7.4 env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes sudo: required - services: - - postgresql addons: - postgresql: "9.6" + postgresql: "10" before_script: - bash ./tests/travis/install-postgres-10.sh - stage: Test - php: 7.3 + php: 7.4 env: DB=pgsql POSTGRESQL_VERSION=11.0 COVERAGE=yes sudo: required services: @@ -237,7 +278,7 @@ jobs: before_script: - bash ./tests/travis/install-postgres-11.sh - stage: Test - php: 7.3 + php: 7.4 env: DB=sqlsrv COVERAGE=yes sudo: required services: @@ -247,7 +288,7 @@ jobs: - bash ./tests/travis/install-mssql-sqlsrv.sh - bash ./tests/travis/install-mssql.sh - stage: Test - php: 7.3 + php: 7.4 env: DB=pdo_sqlsrv COVERAGE=yes sudo: required services: @@ -257,7 +298,7 @@ jobs: - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh - bash ./tests/travis/install-mssql.sh - stage: Test - php: 7.3 + php: 7.4 env: DB=ibm_db2 COVERAGE=yes sudo: required services: @@ -266,12 +307,7 @@ jobs: - bash ./tests/travis/install-db2.sh - bash ./tests/travis/install-db2-ibm_db2.sh - stage: Test - php: 7.3 - env: DB=sqlite DEPENDENCIES=low - install: - - travis_retry composer update --prefer-dist --prefer-lowest - - stage: Test - php: 7.4snapshot + php: nightly env: DB=mysql.docker MYSQL_VERSION=8.0 sudo: required services: @@ -279,7 +315,7 @@ jobs: before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test - php: 7.4snapshot + php: nightly env: DB=mysqli.docker MYSQL_VERSION=8.0 sudo: required services: @@ -287,17 +323,17 @@ jobs: before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test - php: 7.4snapshot + php: nightly env: DB=mariadb MARIADB_VERSION=10.3 addons: mariadb: 10.3 - stage: Test - php: 7.4snapshot + php: nightly env: DB=mariadb.mysqli MARIADB_VERSION=10.3 addons: mariadb: 10.3 - stage: Test - php: 7.4snapshot + php: nightly env: DB=pgsql POSTGRESQL_VERSION=11.0 sudo: required services: @@ -305,10 +341,10 @@ jobs: before_script: - bash ./tests/travis/install-postgres-11.sh - stage: Test - php: 7.4snapshot + php: nightly env: DB=sqlite - stage: Test - php: 7.4snapshot + php: nightly env: DB=sqlsrv sudo: required services: @@ -318,7 +354,7 @@ jobs: - bash ./tests/travis/install-mssql-sqlsrv.sh - bash ./tests/travis/install-mssql.sh - stage: Test - php: 7.4snapshot + php: nightly env: DB=pdo_sqlsrv sudo: required services: @@ -338,3 +374,4 @@ jobs: allow_failures: - env: DEPENDENCIES=dev + - php: nightly diff --git a/composer.lock b/composer.lock index aa0428c2019..e79f9dad815 100644 --- a/composer.lock +++ b/composer.lock @@ -2621,16 +2621,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.0", + "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48" + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", "shasum": "" }, "require": { @@ -2663,12 +2663,12 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-12-19T23:57:18+00:00" + "time": "2019-12-04T04:46:47+00:00" }, { "name": "symfony/console", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 482519c1b72..a60da30be43 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -79,4 +79,10 @@ lib/Doctrine/DBAL/Types/ObjectType.php tests/Doctrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php + + + + lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php + diff --git a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php index 8d0a17c9b43..9514506b31a 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php @@ -43,7 +43,7 @@ protected function setUp() : void $this->connection->insert('caching', $row); } - $config = $this->connection->getConfiguration(); + $config = $this->connection->getConfiguration(); $config->setSQLLogger($this->sqlLogger = new DebugStack()); $cache = new ArrayCache(); diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php index 422740476da..b1a47bc417c 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php @@ -30,7 +30,7 @@ public function testListTableWithBinary() : void public function testColumnCollation() : void { - $table = new Table('test_collation'); + $table = new Table('test_collation'); $table->addOption('collate', $collation = 'utf8_unicode_ci'); $table->addColumn('id', 'integer'); $table->addColumn('text', 'text'); diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php index cf636a797ff..1e3d620c02a 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php @@ -269,7 +269,7 @@ public function testColumnCharsetChange() : void public function testColumnCollation() : void { - $table = new Table('test_collation'); + $table = new Table('test_collation'); $table->addOption('collate', $collation = 'latin1_swedish_ci'); $table->addOption('charset', 'latin1'); $table->addColumn('id', 'integer'); diff --git a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php index 18a8a0ef1d2..e6d4975daed 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php @@ -170,7 +170,6 @@ public function testModifyLimitQueryWithSubSelectInSelectList() : void ); self::assertEquals( - 'SELECT ' . 'u.id, ' . '(u.foo/2) foodiv, ' . diff --git a/tests/travis/create-mysql-schema.sql b/tests/travis/create-mysql-schema.sql index 4e331838cfd..78a32358065 100644 --- a/tests/travis/create-mysql-schema.sql +++ b/tests/travis/create-mysql-schema.sql @@ -1,3 +1,6 @@ +DROP USER IF EXISTS 'travis'@'%'; +CREATE USER 'travis'@'%'; + CREATE SCHEMA doctrine_tests; CREATE SCHEMA test_create_database; CREATE SCHEMA test_drop_database; diff --git a/tests/travis/install-mariadb.sh b/tests/travis/install-mariadb.sh new file mode 100644 index 00000000000..cda81e9bcba --- /dev/null +++ b/tests/travis/install-mariadb.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -ex + +sudo docker run \ + -d \ + -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ + -e MYSQL_DATABASE=doctrine_tests \ + -p 33306:3306 \ + --name mariadb \ + mariadb:${MARIADB_VERSION} + +sudo docker exec -i mariadb bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done' diff --git a/tests/travis/install-sqlsrv-dependencies.sh b/tests/travis/install-sqlsrv-dependencies.sh index 137b2a95705..ff91bfdfaf0 100644 --- a/tests/travis/install-sqlsrv-dependencies.sh +++ b/tests/travis/install-sqlsrv-dependencies.sh @@ -5,6 +5,6 @@ set -ex echo Installing driver dependencies curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - -curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql.list +curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql.list sudo apt-get update ACCEPT_EULA=Y sudo apt-get install -qy msodbcsql17 unixodbc unixodbc-dev libssl1.0.0 diff --git a/tests/travis/mariadb.docker.travis.xml b/tests/travis/mariadb.docker.travis.xml new file mode 100644 index 00000000000..fa6617c0948 --- /dev/null +++ b/tests/travis/mariadb.docker.travis.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + ../Doctrine/Tests/DBAL + + + + + + ../../lib/Doctrine + + + + + + performance + locking_functional + + + diff --git a/tests/travis/mariadb.mysqli.docker.travis.xml b/tests/travis/mariadb.mysqli.docker.travis.xml new file mode 100644 index 00000000000..679415d7a18 --- /dev/null +++ b/tests/travis/mariadb.mysqli.docker.travis.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + ../Doctrine/Tests/DBAL + + + + + + ../../lib/Doctrine + + + + + + performance + locking_functional + + + diff --git a/tests/travis/mariadb.mysqli.travis.xml b/tests/travis/mariadb.mysqli.travis.xml index dfc62d307c5..b8bd9be01cd 100644 --- a/tests/travis/mariadb.mysqli.travis.xml +++ b/tests/travis/mariadb.mysqli.travis.xml @@ -2,7 +2,6 @@ -