Orchestra Testbench is a Laravel testing helper designed for package development. By extending Orchestra\Testbench\TestCase, you can test your package in isolation while still booting a Laravel application context.Laravel’s package documentation also recommends Testbench for package testing workflows. See Laravel Package Development.
Start by testing package bootstrap behavior: provider registration, facade calls, and configuration values.
<?phpnamespace Vendor\Package\Tests\Feature;use Vendor\Package\Facades\Package;use Vendor\Package\PackageServiceProvider;use Vendor\Package\Tests\TestCase;class PackageBootstrapTest extends TestCase{ public function test_service_provider_is_registered(): void { $this->assertTrue($this->app->providerIsLoaded(PackageServiceProvider::class)); } public function test_facade_returns_expected_value(): void { // Verify behavior through the facade $this->assertSame('ok', Package::status()); } public function test_package_config_is_available(): void { // Assert the value configured in defineEnvironment() $this->assertTrue(config('package.enabled')); }}
Testbench gives you a reliable, app-like test environment for package development without creating a full Laravel app manually. By covering providers, config, facades, and database behavior, you reduce regressions before release.