PHPStan Notify test cleanup, 2026-07-06.
Fixed locally in mono repo:
tests/Unit/Actions/NetfunSendActionTest.php: replaced unsafe class_uses / file_get_contents with Safe variants, narrowed ReflectionType to ReflectionNamedType, handled ReflectionClass::getFileName() returning false.
tests/Unit/Services/NotificationManagerTest.php: replaced mock recipients with a minimal Eloquent Model, and updated expectations from non-called execute() to real SendNotificationAction::handle().
- Updated
docs/wiki/concepts/phpstan-pest-test-doubles.md with the reflection/Safe-function rule.
Verification:
./vendor/bin/phpstan analyse Modules/Notify/tests/Unit/Actions/NetfunSendActionTest.php -> OK.
./vendor/bin/pest Modules/Notify/tests/Unit/Actions/NetfunSendActionTest.php --configuration phpunit.xml --colors=never --compact -> 10 passed, 15 assertions.
./vendor/bin/phpstan analyse Modules/Notify/tests/Unit/Services/NotificationManagerTest.php -> OK.
./vendor/bin/pest Modules/Notify/tests/Unit/Services/NotificationManagerTest.php --configuration phpunit.xml --colors=never --compact -> no tests found, because it is a PHPUnit-style class with @test methods.
- PHPMD blocked:
laravel/tools/phpmd.phar missing.
Current blocker:
./vendor/bin/phpstan analyse Modules/Notify/tests stops on tests/Unit/Actions/SMS/SendAgiletelecomSMSv1ActionTest.php with Cannot use function Safe\\class_uses as class_uses because the name is already in use.
- That file and the SMS action test group are locked in the mono repo (
*.lock present), so I did not edit them.
— Codex (gpt-5-codex)
PHPStan Notify test cleanup, 2026-07-06.
Fixed locally in mono repo:
tests/Unit/Actions/NetfunSendActionTest.php: replaced unsafeclass_uses/file_get_contentswith Safe variants, narrowedReflectionTypetoReflectionNamedType, handledReflectionClass::getFileName()returningfalse.tests/Unit/Services/NotificationManagerTest.php: replaced mock recipients with a minimal EloquentModel, and updated expectations from non-calledexecute()to realSendNotificationAction::handle().docs/wiki/concepts/phpstan-pest-test-doubles.mdwith the reflection/Safe-function rule.Verification:
./vendor/bin/phpstan analyse Modules/Notify/tests/Unit/Actions/NetfunSendActionTest.php-> OK../vendor/bin/pest Modules/Notify/tests/Unit/Actions/NetfunSendActionTest.php --configuration phpunit.xml --colors=never --compact-> 10 passed, 15 assertions../vendor/bin/phpstan analyse Modules/Notify/tests/Unit/Services/NotificationManagerTest.php-> OK../vendor/bin/pest Modules/Notify/tests/Unit/Services/NotificationManagerTest.php --configuration phpunit.xml --colors=never --compact-> no tests found, because it is a PHPUnit-style class with@testmethods.laravel/tools/phpmd.pharmissing.Current blocker:
./vendor/bin/phpstan analyse Modules/Notify/testsstops ontests/Unit/Actions/SMS/SendAgiletelecomSMSv1ActionTest.phpwithCannot use function Safe\\class_uses as class_uses because the name is already in use.*.lockpresent), so I did not edit them.— Codex (
gpt-5-codex)