Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Testing Laravel Package

spiral/testing

Spiral Testing SDK provides a TestCase and custom TestApp implementation for testing Spiral Framework applications and packages. Configure bootloaders and root directory to run tests without building extra app classes. Requires PHP 8.1+ and Spiral 3.15+.

View on GitHub
Deep Wiki
Context7

Spiral Framework testing SDK

Frequently asked questions about Testing
What is spiral/testing used for?
It is the official testing SDK for the Spiral Framework, not Laravel. It provides a TestCase and TestApp implementation for testing Spiral applications and packages with PHPUnit. It lets you configure bootloaders and a root directory without building extra application classes.
Does spiral/testing work with Laravel?
No. It has no Laravel service provider, no Illuminate Foundation Testing integration, and no compatibility with Laravel's TestCase, RefreshDatabase, HTTP kernel, or container. If your application is Laravel, this package is out of scope.
How do I install spiral/testing?
Install it as a dev dependency with composer require spiral/testing --dev. Your environment must meet PHP 8.1+ and Spiral Framework 3.15+. Then extend the package TestCase in your test suite.
How do I configure spiral/testing for package tests?
Extend the package TestCase and implement rootDirectory() to point at your package root. Implement defineBootloaders() to list the bootloaders your package needs. This lets the SDK build a test app without a full application skeleton.
Which PHPUnit version does spiral/testing require?
The SDK tracks PHPUnit majors and has had breaking bumps, including 3.0.0 moving to PHPUnit 13.0.5. Older releases handled specific conflicts, such as 2.9.1 for PHPUnit 10.5.46. Check the release you pin against your PHPUnit major before upgrading.
Which Spiral Framework version is required by spiral/testing?
The current SDK has a hard floor of Spiral Framework 3.15+. Earlier SDK versions had different framework floors; for example, 2.7.0 was needed for Spiral 3.12 dispatchers. Upgrade the SDK and framework in lockstep.
What fakes are available in spiral/testing?
It includes fakes for HTTP with middleware controls and JSON helpers, event dispatcher assertions such as assertDispatched and assertListening, queue payloads, console and scaffolder commands, config fragments, and container bindings. These cover the surfaces Spiral apps commonly need in integration tests.
Can spiral/testing handle long-running worker state between requests?
It is designed for Spiral's RoadRunner-first, long-running-worker model, including scope bindings, current-scope containers, and finalizers per request. Recent releases added finalizer calls after each FakeHTTP request and a TestScope attribute. Still, smoke-test your own long-running-state scenarios because container leakage has been a historical risk.
Is spiral/testing actively maintained and safe to use in production?
It is a dev-only dependency and should be added to require-dev, not installed in production. The changelog shows continuous, small, purposeful fixes from identifiable Spiral core maintainers, despite low external adoption. Run composer install --no-dev for production deployments.
What are alternatives to spiral/testing?
If you are on Spiral, the official SDK is the intended harness; there is no direct Laravel or Symfony KernelTestCase adapter. For Laravel apps, use Laravel's own testing tools or Pest's Laravel plugin instead. For generic PHP, PHPUnit alone may work, but you lose Spiral-specific fakes and bootloader handling.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager