diff --git a/.gitignore b/.gitignore index cb308cf..ee01cae 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ phpunit.xml .runway-config.json .runway-creds.json .DS_Store +.phpunit-watcher.yml diff --git a/composer.json b/composer.json index f0e1da1..5355731 100644 --- a/composer.json +++ b/composer.json @@ -56,6 +56,7 @@ "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^9.6", "rregeer/phpunit-coverage-check": "^0.3.1", + "spatie/phpunit-watcher": "^1.23", "squizlabs/php_codesniffer": "^4.0" }, "config": { @@ -67,10 +68,7 @@ }, "scripts": { "test": "phpunit", - "test-watcher": [ - "phpunit-watcher || composer global require spatie/phpunit-watcher --dev", - "phpunit-watcher watch" - ], + "test-watcher": "phpunit-watcher watch", "test-coverage": [ "rm -f clover.xml", "@putenv XDEBUG_MODE=coverage", @@ -105,7 +103,8 @@ "post-install-cmd": [ "@php -r \"if (!file_exists('phpcs.xml')) copy('phpcs.xml.dist', 'phpcs.xml');\"", "@php -r \"if (!file_exists('phpstan.neon')) copy('phpstan.dist.neon', 'phpstan.neon');\"", - "@php -r \"if (!file_exists('phpunit.xml')) copy('phpunit.xml.dist', 'phpunit.xml');\"" + "@php -r \"if (!file_exists('phpunit.xml')) copy('phpunit.xml.dist', 'phpunit.xml');\"", + "@php -r \"if (!file_exists('.phpunit-watcher.yml')) copy('phpunit-watcher.yml', '.phpunit-watcher.yml');\"" ] }, "suggest": { diff --git a/phpunit-watcher.yml b/phpunit-watcher.yml index 5b5fe13..d942a41 100644 --- a/phpunit-watcher.yml +++ b/phpunit-watcher.yml @@ -1,13 +1,13 @@ hideManual: true -watch: - directories: - - tests - - flight - fileMask: '*.php' notifications: - passingTests: false failingTests: false + passingTests: false phpunit: - binaryPath: ./vendor/bin/phpunit arguments: '--stop-on-failure' + binaryPath: ./vendor/bin/phpunit timeout: 180 +watch: + directories: + - tests + - flight + fileMask: '*.php'