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

Testbench Core Laravel Package

orchestra/testbench-core

Testbench Core is a testing framework for Laravel package development. It boots a Laravel application inside your package repository, letting tests run Artisan commands, migrations, factories, and routes, with releases matching Laravel 6 through 13.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for package test infrastructure. If your team ships Laravel packages (internal shared libraries, SDKs, client-facing extensions, marketplace plugins), the alternative to Testbench is hand-rolling a Laravel application bootstrap inside each package repo — config stubs, service provider registration, migration wiring, factory loading, artisan invocation. Testbench Core is that harness, maintained, MIT-licensed, tracking every Laravel major since 6.x. The decision is "adopt the de facto standard" vs. "own ~1–2 engineer-weeks plus permanent maintenance."
  • Framework upgrade roadmap. The version compatibility matrix is the most PM-relevant artifact here: Laravel 6→13 and PHPUnit 12.x/13.x are already supported, with releases landing within days of Laravel point releases. That gives you a defensible answer when planning "we move to Laravel 13 next quarter" — the test harness is not a blocker. Conversely, it establishes a constraint: Testbench major versions are pinned to Laravel majors, so Laravel upgrades and Testbench upgrades ship as one work item, not two.
  • Package-vs-application architecture calls. Testbench exists specifically to boot a Laravel app from inside a package repository. If a product decision pushes code into a distributable package (white-labeling, multi-tenant extensions, a plugin ecosystem, extracting a shared domain library), Testbench is the enabling capability that makes that extraction testable. Without it, extracted packages tend to lose integration test coverage and rot.
  • Test surface / fidelity investment. Because it loads a real application, tests can exercise artisan commands, migrations, factories, routing, and config — not just unit-level mocks. This underwrites decisions about how much integration coverage to buy versus unit coverage, and about whether a "package:test" style workflow fits your CI.
  • Ecosystem surface selection. Testbench Core is the base layer under orchestra/testbench (standard), testbench-browser-kit (CSS-selector interaction, no JS), testbench-dusk (real Chrome, JS), and workbench (local preview of the package). That's a clean ladder: pick the lowest rung that covers your risk. Choosing Dusk when BrowserKit suffices is a recurring CI cost decision.
  • Developer onboarding and time-to-first-test. A standardized harness means a new engineer can run a package's suite without learning a bespoke bootstrap. That's a measurable DX lever (time-to-green-CI for new hires, PR cycle time).
  • Do not be misled by the raw metrics. Zero listed dependents and a score of 15 reflect that Core is a transitive, dev-only dependency — nearly everyone installs orchestra/testbench, which pulls Core in. It is not a signal of weak adoption. Likewise, "opportunity 55.25" reads as infrastructure plumbing: high leverage, low differentiation, which is exactly what you want from a test harness.

When to Consider This Package

Adopt when:

  • You maintain one or more Laravel packages that need to be tested in the context of a booted application (service providers, config publishing, migrations, commands, routes).
  • You are extracting a shared library out of a monolith and need to preserve integration coverage post-extraction.
  • Your CI must verify package behavior across supported Laravel major versions; the version matrix gives you the mapping to build that matrix.
  • You need artisan/migration/factory-level testing without standing up a full application repo per package.

Adoption guidance: depend on orchestra/testbench (or testbench-browser-kit / testbench-dusk), not orchestra/testbench-core directly. Core is the engine; the meta-package is the supported entry point. Declaring Core directly invites version-skew bugs and bypasses the compatibility guarantees. Keep it in require-dev only — production runtime footprint should be zero.

Look elsewhere when:

  • You are building an application, not a package. Native Laravel testing (RefreshDatabase, actingAs, HTTP tests) already boots the app; Testbench adds indirection with no payoff.
  • You need true browser/JavaScript coverage — go to testbench-dusk, not Core. If you need cross-browser or Selenium-grid scale-out, evaluate a dedicated E2E stack instead.
  • You are testing stateless libraries or pure PHP utilities with no Laravel container coupling. Unit tests are cheaper and faster.
  • Your organization standardizes on a monorepo where packages are tested inside the host application's suite. Testbench's value is highest when packages live in isolated repos.
  • You require a vendor SLA or a single accountable maintainer. This is a community package under the Orchestral org; budget for the possibility of upstream lag on a bleeding-edge Laravel or PHPUnit release (historically the gap has been short, but it is not contractual).

Risk to track: tight lock-step with Laravel and PHPUnit means the harness inherits their release cadence. Blast radius is CI-only, not production, which keeps this a low-severity dependency — but a broken harness blocks all package merges, so pin versions and upgrade deliberately.

How to Pitch It (Stakeholders)

To executives (one paragraph): Testbench Core is the standard, free, MIT-licensed test harness that lets our Laravel packages be tested as if they were running inside a real application. It is a development-only dependency with zero production footprint. Adopting it instead of building our own removes a recurring maintenance cost, keeps package code covered as we extract shared components, and — critically — it already supports Laravel through 13.x, so it will not gate our framework upgrade roadmap. The main cost is discipline: it upgrades in lock-step with Laravel, so we treat those as one planned work item.

To engineering leadership: this is developer-productivity infrastructure, not a product feature. Value shows up as lower cost per package, preserved integration coverage after extraction, and faster onboarding onto package repos. Risk is concentrated in CI availability, not production, and is mitigated by pinning versions and standardizing on orchestra/testbench rather than the core package.

To engineers: use the meta-package, keep it in require-dev, choose the lowest rung of the ladder that covers your risk (Testbench → BrowserKit → Dusk), and expect to upgrade it alongside Laravel and PHPUnit majors. Do not fork or wrap Core; if you need behavior it doesn't provide, that's a signal you're testing at the wrong layer.

What I would not claim: that this differentiates the product, improves end-user experience, or reduces runtime risk. It buys engineering leverage and upgrade optionality — nothing more, and that is enough to justify a dev dependency.

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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log