filamentphp/plugin-skeleton workflow test jobs failing (after fixing some errors)

Hi! I'm new to plugin development. I used the template and after fixing some things (like removing the unused spatie services and changing the non-existent Icon class) the test workflow on Github is still mostly failing. The only succesful workflow job is P8.2 - L10.* - prefer-stable - ubuntu-latest. The error I seem to be getting after the command vendor/bin/pest --ci:
PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit\Event\Facade::instance() in /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/nunomaduro/collision/src/Adapters/Phpunit/Subscribers/EnsurePrinterIsRegisteredSubscriber.php:306
Stack trace:
#0 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/nunomaduro/collision/src/Adapters/Phpunit/Autoload.php(11): NunoMaduro\Collision\Adapters\Phpunit\Subscribers\EnsurePrinterIsRegisteredSubscriber::register()
#1 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/composer/autoload_real.php(41): require('...')
#2 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/composer/autoload_real.php(45): {closure}()
#3 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/autoload.php(25): ComposerAutoloaderInit5db1f2f2862bb4049ece0aa2034dfe35::getLoader()
#4 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/pestphp/pest/bin/pest(61): include_once('...')
#5 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/pestphp/pest/bin/pest(100): {closure}()
#6 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/bin/pest(119): include('...')
#7 {main}
thrown in /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/nunomaduro/collision/src/Adapters/Phpunit/Subscribers/EnsurePrinterIsRegisteredSubscriber.php on line 306
Error: Process completed with exit code 255.
PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit\Event\Facade::instance() in /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/nunomaduro/collision/src/Adapters/Phpunit/Subscribers/EnsurePrinterIsRegisteredSubscriber.php:306
Stack trace:
#0 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/nunomaduro/collision/src/Adapters/Phpunit/Autoload.php(11): NunoMaduro\Collision\Adapters\Phpunit\Subscribers\EnsurePrinterIsRegisteredSubscriber::register()
#1 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/composer/autoload_real.php(41): require('...')
#2 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/composer/autoload_real.php(45): {closure}()
#3 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/autoload.php(25): ComposerAutoloaderInit5db1f2f2862bb4049ece0aa2034dfe35::getLoader()
#4 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/pestphp/pest/bin/pest(61): include_once('...')
#5 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/pestphp/pest/bin/pest(100): {closure}()
#6 /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/bin/pest(119): include('...')
#7 {main}
thrown in /home/runner/work/filament-nested-resources/filament-nested-resources/vendor/nunomaduro/collision/src/Adapters/Phpunit/Subscribers/EnsurePrinterIsRegisteredSubscriber.php on line 306
Error: Process completed with exit code 255.
How do I fix this one and get all jobs working?
Solution:
I managed to get it working, the instance() function was added in phpunit version 10.0.17. Just add this: "phpunit/phpunit": "^10.0.17", to your require-dev in composer.json
Jump to solution
3 Replies
Quadrubo
Quadrubo13mo ago
Hey @TimeglitchD , did you manage to get this working? I'm encountering the same issue.
Solution
Quadrubo
Quadrubo13mo ago
I managed to get it working, the instance() function was added in phpunit version 10.0.17. Just add this: "phpunit/phpunit": "^10.0.17", to your require-dev in composer.json
TimeglitchD
TimeglitchDOP13mo ago
Alright! To be fair I abandoned this a while ago, but I'm glad you solved it. Thank you!
Want results from more Discord servers?
Add your server