From 867a5647084644c977dc90ace5db0a4842ef8607 Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:52:15 -0400 Subject: [PATCH 1/4] composer require -W --dev spatie/phpunit-watcher --- composer.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 70a09ca..ed7742a 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", From 036a9a53155198275e7bea283de4e49b2026a0ed Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:52:31 -0400 Subject: [PATCH 2/4] sort phpunit-watcher.yml --- phpunit-watcher.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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' From 6d0bbdb9a6db773190cbd2f14aa6ebd232518e39 Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:53:09 -0400 Subject: [PATCH 3/4] ignore .phpunit-watcher.yml to allow contributors customize phpunit-watcher --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From e3f314b2acfd4028558dcbd99369c2acef3200df Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:56:27 -0400 Subject: [PATCH 4/4] add .phpunit-watcher.yml creation after composer install --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ed7742a..b0d02df 100644 --- a/composer.json +++ b/composer.json @@ -103,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": {