From 0dae29aaddf1cb5e3f5132e65115b2c0f1e45f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=BDoljom?= Date: Wed, 18 May 2022 12:36:28 +0200 Subject: [PATCH] Fix argument check --- CHANGELOG.md | 8 ++++++++ templates/bootstrap-plugin.php.tmpl | 2 +- templates/bootstrap-theme.php.tmpl | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e3822..61421c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a _No documentation available about unreleased changes as of yet._ +## [1.2.0] Update bootstrap + +### Changed +- Fixed the `--group=integration` check in the bootstrap + - Before it depended on the position of the argument, so in PhpStorm running tests + failed because the argument wasn't in the second place. + ## [1.1.0] Update base test case ### Changed @@ -19,5 +26,6 @@ _No documentation available about unreleased changes as of yet._ - Added the functionality for the WordPress integration tests with PestPHP package. [Unreleased]: https://github.com/dingo-d/wp-pest-integration-test-setup/compare/main...HEAD +[1.1.0]: https://github.com/https://github.com/dingo-d/wp-pest-integration-test-setup/compare/1.1.0...1.2.0 [1.1.0]: https://github.com/https://github.com/dingo-d/wp-pest-integration-test-setup/compare/1.0.0...1.1.0 [1.0.0]: https://github.com/https://github.com/dingo-d/wp-pest-integration-test-setup/compare/cadf3ac...1.0.0 diff --git a/templates/bootstrap-plugin.php.tmpl b/templates/bootstrap-plugin.php.tmpl index 3aedf8c..725948e 100644 --- a/templates/bootstrap-plugin.php.tmpl +++ b/templates/bootstrap-plugin.php.tmpl @@ -12,7 +12,7 @@ require_once dirname(__FILE__, 2) . $ds . 'vendor' . $ds . 'autoload.php'; * add additional argument to the test run command if you want to run * integration tests. */ -if (isset($GLOBALS['argv']) && isset($GLOBALS['argv'][1]) && strpos($GLOBALS['argv'][1], 'integration') !== false) { +if (isset($GLOBALS['argv']) && in_array('--group=integration', $GLOBALS['argv'], true)) { if (!file_exists(dirname(__FILE__, 2) . '/wp/tests/phpunit/wp-tests-config.php')) { // We need to set up core config details and test details copy( diff --git a/templates/bootstrap-theme.php.tmpl b/templates/bootstrap-theme.php.tmpl index 396c6c1..d80b23e 100644 --- a/templates/bootstrap-theme.php.tmpl +++ b/templates/bootstrap-theme.php.tmpl @@ -12,7 +12,7 @@ require_once dirname(__FILE__, 2) . $ds . 'vendor' . $ds . 'autoload.php'; * add additional argument to the test run command if you want to run * integration tests. */ -if (isset($GLOBALS['argv']) && isset($GLOBALS['argv'][1]) && strpos($GLOBALS['argv'][1], 'integration') !== false) { +if (isset($GLOBALS['argv']) && in_array('--group=integration', $GLOBALS['argv'], true)) { if (!file_exists(dirname(__FILE__, 2) . '/wp/tests/phpunit/wp-tests-config.php')) { // We need to set up core config details and test details copy(