Switon's test bootstrap and fixtures for package-level tests.
- Ready test base: package tests start with a Switon container already wired.
- Common defaults: core services and test doubles are prebound.
- Reusable test doubles: logger, events, console, clock, cache, random, and translator are prebound.
- Listener support:
MockListenerProviderkeeps event wiring lightweight in tests. - Package-aware checks:
ComposerExtraandPackagePathAssertsupport monorepo discovery and path checks.
composer require --dev switon/testinguse Switon\Testing\TestCase;
final class UserServiceTest extends TestCase
{
public function testRegisterCreatesUser(): void
{
$service = $this->make(UserService::class);
$user = $service->register('test@example.com');
self::assertSame('test@example.com', $user->email);
}
}Docs: https://docs.switon.dev/latest/testing
MIT.