dingo-d / wp-pest

A package that will add WordPress integration test suite with Pest
MIT License
119 stars 5 forks source link

Fix argument check #8

Closed dingo-d closed 2 years ago

dingo-d commented 2 years ago

The check whether to load the WordPress part of the bootstrap process failed in PhpStorm, because the command that is running in the IDE is something like

/opt/homebrew/opt/php@7.4/bin/php .../vendor/pestphp/pest/bin/pest --teamcity --group=integration --configuration .../phpunit.xml

Because PhpStorm injects the --teamcity option to the pest command the --group=integration argument wasn't in the second place so the check for

isset($GLOBALS['argv'][1]) && strpos($GLOBALS['argv'][1], 'integration') !== false

Failed.

The proposed PR fixes that issue by just checking the array for the argument.