diff --git a/.gitignore b/.gitignore index 2cae83d..baf8793 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ composer.lock phpcs.xml phpstan.neon +phpunit-watcher.yml phpunit.xml diff --git a/composer.json b/composer.json index 5e72dd7..4b49279 100644 --- a/composer.json +++ b/composer.json @@ -49,6 +49,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": { @@ -60,10 +61,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", @@ -98,7 +96,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.dist', 'phpunit-watcher.yml');\"" ] }, "suggest": { diff --git a/phpunit-watcher.yml b/phpunit-watcher.yml.dist similarity index 93% rename from phpunit-watcher.yml rename to phpunit-watcher.yml.dist index 6b158df..86c3979 100644 --- a/phpunit-watcher.yml +++ b/phpunit-watcher.yml.dist @@ -2,7 +2,7 @@ hideManual: true watch: directories: - tests - - flight + - src fileMask: '*.php' notifications: passingTests: false