From 2f14b03cb692997b7d8233bc342b329973d6a3ac Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 23 Mar 2022 17:18:07 -0400 Subject: [PATCH 01/11] Update composer.json Signed-off-by: Nathanael Esayeas --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index be7db1db..58c3cbbc 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "laminas/laminas-stdlib": "^3.7.1" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.2.1", + "laminas/laminas-coding-standard": "^2.3.0", "laminas/laminas-eventmanager": "^3.4.0", "laminas/laminas-hydrator": "^3.2 || ^4.3", "laminas/laminas-servicemanager": "^3.7.0", From 190bc28d4dc5e799ca02107611640b9f02bafcc9 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 23 Mar 2022 17:18:12 -0400 Subject: [PATCH 02/11] Update composer.lock Signed-off-by: Nathanael Esayeas --- composer.lock | 82 ++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/composer.lock b/composer.lock index e4296172..bdb6dab7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5fc4a788c1c5079ecaecef7dd1cd9bd4", + "content-hash": "509b603016cbcac8c89ba680c13f52e3", "packages": [ { "name": "laminas/laminas-stdlib", @@ -250,24 +250,24 @@ }, { "name": "laminas/laminas-coding-standard", - "version": "2.2.1", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-coding-standard.git", - "reference": "c953ecb1d37034f4aa326046e2c24a10fe0a2845" + "reference": "bcf6e07fe4690240be7beb6d884d0b0fafa6a251" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-coding-standard/zipball/c953ecb1d37034f4aa326046e2c24a10fe0a2845", - "reference": "c953ecb1d37034f4aa326046e2c24a10fe0a2845", + "url": "https://api.github.com/repos/laminas/laminas-coding-standard/zipball/bcf6e07fe4690240be7beb6d884d0b0fafa6a251", + "reference": "bcf6e07fe4690240be7beb6d884d0b0fafa6a251", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.3 || ~8.0.0", - "slevomat/coding-standard": "^6.4.1", - "squizlabs/php_codesniffer": "^3.5.8", - "webimpress/coding-standard": "^1.1.6" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "php": "^7.3 || ^8.0", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.6", + "webimpress/coding-standard": "^1.2" }, "type": "phpcodesniffer-standard", "autoload": { @@ -299,7 +299,7 @@ "type": "community_bridge" } ], - "time": "2021-05-17T17:39:41+00:00" + "time": "2021-05-29T15:53:59+00:00" }, { "name": "laminas/laminas-eventmanager", @@ -1050,37 +1050,33 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "0.4.9", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531" + "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/98a088b17966bdf6ee25c8a4b634df313d8aa531", - "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/dbc093d7af60eff5cd575d2ed761b15ed40bd08e", + "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "consistence/coding-standard": "^3.5", - "ergebnis/composer-normalize": "^2.0.2", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", + "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.26", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^4.7.2", - "symfony/process": "^4.0" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.4-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1097,9 +1093,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/master" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.2.0" }, - "time": "2020-08-03T20:32:43+00:00" + "time": "2021-09-16T20:46:02+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2536,37 +2532,37 @@ }, { "name": "slevomat/coding-standard", - "version": "6.4.1", + "version": "7.0.19", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "696dcca217d0c9da2c40d02731526c1e25b65346" + "reference": "bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/696dcca217d0c9da2c40d02731526c1e25b65346", - "reference": "696dcca217d0c9da2c40d02731526c1e25b65346", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37", + "reference": "bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", "php": "^7.1 || ^8.0", - "phpstan/phpdoc-parser": "0.4.5 - 0.4.9", - "squizlabs/php_codesniffer": "^3.5.6" + "phpstan/phpdoc-parser": "^1.0.0", + "squizlabs/php_codesniffer": "^3.6.2" }, "require-dev": { - "phing/phing": "2.16.3", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpstan/phpstan": "0.12.48", - "phpstan/phpstan-deprecation-rules": "0.12.5", - "phpstan/phpstan-phpunit": "0.12.16", - "phpstan/phpstan-strict-rules": "0.12.5", - "phpunit/phpunit": "7.5.20|8.5.5|9.4.0" + "phing/phing": "2.17.2", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.4.6", + "phpstan/phpstan-deprecation-rules": "1.0.0", + "phpstan/phpstan-phpunit": "1.0.0", + "phpstan/phpstan-strict-rules": "1.1.0", + "phpunit/phpunit": "7.5.20|8.5.21|9.5.16" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-master": "6.x-dev" + "dev-master": "7.x-dev" } }, "autoload": { @@ -2581,7 +2577,7 @@ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/6.4.1" + "source": "https://github.com/slevomat/coding-standard/tree/7.0.19" }, "funding": [ { @@ -2593,7 +2589,7 @@ "type": "tidelift" } ], - "time": "2020-10-05T12:39:37+00:00" + "time": "2022-03-01T18:01:41+00:00" }, { "name": "squizlabs/php_codesniffer", From d6860fbb3578bfb51639f80b39fe0a09d8a7bdbe Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Thu, 24 Mar 2022 02:37:50 -0400 Subject: [PATCH 03/11] Delete IntegrationTestListener.php Signed-off-by: Nathanael Esayeas --- test/integration/IntegrationTestListener.php | 68 -------------------- 1 file changed, 68 deletions(-) delete mode 100644 test/integration/IntegrationTestListener.php diff --git a/test/integration/IntegrationTestListener.php b/test/integration/IntegrationTestListener.php deleted file mode 100644 index 38bc0608..00000000 --- a/test/integration/IntegrationTestListener.php +++ /dev/null @@ -1,68 +0,0 @@ -getName() !== 'integration test') { - return; - } - - if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_MYSQL')) { - $this->fixtureLoaders[] = new MysqlFixtureLoader(); - } - - if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL')) { - $this->fixtureLoaders[] = new PgsqlFixtureLoader(); - } - - if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV')) { - $this->fixtureLoaders[] = new SqlServerFixtureLoader(); - } - - if (empty($this->fixtureLoaders)) { - return; - } - - printf("\nIntegration test started.\n"); - - foreach ($this->fixtureLoaders as $fixtureLoader) { - $fixtureLoader->createDatabase(); - } - } - - public function endTestSuite(TestSuite $suite): void - { - if ( - $suite->getName() !== 'integration test' - || empty($this->fixtureLoader) - ) { - return; - } - - printf("\nIntegration test ended.\n"); - - foreach ($this->fixtureLoaders as $fixtureLoader) { - $fixtureLoader->dropDatabase(); - } - } -} From a85bd9d2a1ff774fab892d335851cd6197a314b6 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Thu, 24 Mar 2022 02:51:14 -0400 Subject: [PATCH 04/11] Create IntegrationTestPHPUnitExtension.php Signed-off-by: Nathanael Esayeas --- .../IntegrationTestPHPUnitExtension.php | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 test/integration/IntegrationTestPHPUnitExtension.php diff --git a/test/integration/IntegrationTestPHPUnitExtension.php b/test/integration/IntegrationTestPHPUnitExtension.php new file mode 100644 index 00000000..327f50fe --- /dev/null +++ b/test/integration/IntegrationTestPHPUnitExtension.php @@ -0,0 +1,86 @@ +getPhpUnitParameter("testsuite") !== 'integration test') { + return; + } + + if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_MYSQL')) { + $this->fixtureLoaders[] = new MysqlFixtureLoader(); + } + + if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL')) { + $this->fixtureLoaders[] = new PgsqlFixtureLoader(); + } + + if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV')) { + $this->fixtureLoaders[] = new SqlServerFixtureLoader(); + } + + if (empty($this->fixtureLoaders)) { + return; + } + + printf("\nIntegration test started.\n"); + + foreach ($this->fixtureLoaders as $fixtureLoader) { + $fixtureLoader->createDatabase(); + } + } + + public function executeAfterLastTest(): void + { + if ( + $this->getPhpUnitParameter("testsuite") === 'integration test' || + $this->fixtureLoaders === [] + ) { + return; + } + + printf("\nIntegration test ended.\n"); + + foreach ($this->fixtureLoaders as $fixtureLoader) { + $fixtureLoader->dropDatabase(); + } + } + + /** + * Resolves the parameters passed in to PHPUnit. + * + * eg. "phpunit --testsuite Unit --filter FirstTest" + * + * $this->getPhpUnitParameter("filter"); // Unit + * $this->getPhpUnitParameter("testsuite"); // FirstTest + */ + private function getPhpUnitParameter(string $paramName): ?string + { + global $argv; + + if ($offset = array_search("--$paramName", $argv) === false) { + return null; + } + + return trim($argv[$offset + 1]); + } +} From 5410f975aa5002be3d77132508c47dc540655169 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Thu, 24 Mar 2022 02:51:21 -0400 Subject: [PATCH 05/11] Update phpunit.xml.dist Signed-off-by: Nathanael Esayeas --- .laminas-ci/phpunit.xml | 6 +++--- phpunit.xml.dist | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.laminas-ci/phpunit.xml b/.laminas-ci/phpunit.xml index 784bfc1e..0fe4b75e 100644 --- a/.laminas-ci/phpunit.xml +++ b/.laminas-ci/phpunit.xml @@ -22,9 +22,9 @@ - - - + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 09cf43f9..db58a184 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -19,9 +19,9 @@ - - - + + +