Skip to content

Repository files navigation

Switon Testing Package

CIPHP 8.3+

Switon's test bootstrap and fixtures for package-level tests.

Highlights

  • 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:MockListenerProvider keeps event wiring lightweight in tests.
  • Package-aware checks:ComposerExtra and PackagePathAssert support monorepo discovery and path checks.

Installation

composer require --dev switon/testing

Quick Start

useSwiton\Testing\TestCase;
finalclass UserServiceTest extends TestCase
{
publicfunctiontestRegisterCreatesUser(): 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

License

MIT.

About

Shared test container, TestCase base, and package-local test runner for Switon Framework

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages