Run the test suite on Orchestra Testbench - #1055
Open
dazza-dev wants to merge 1 commit into
Open
Conversation
tests/Test.php searches three candidate paths for a laravel/laravel
checkout and requires its bootstrap/app.php. That skeleton is rewritten
every major release, so the harness has to be rewritten alongside it:
Laravel 11 drops app/Http/Kernel.php and app/Console/Kernel.php
entirely, and the current bootstrap cannot boot it at all.
Testbench ships the skeleton instead and tracks it release by release.
It is also what a contributor to any other Laravel package expects to
find, and it drops laravel/laravel from require-dev.
Three tests reached into the skeleton and had to be pointed elsewhere:
- RunCommandTest registered console commands through App\Console\Kernel.
It now resolves the kernel contract, which is what it always wanted.
- TenantAwareJobTest notified an App\Models\User. The assertion is about
the website_id in the queue payload, so the notifiable does not need
to be a database model, and the users table stops being a dependency.
- RouteProviderTest counted on laravel/laravel shipping exactly one web
route and one api route -- the tenant route replaces the global one
rather than adding to it, since RouteCollection keys by method and
URI, and the assertion of 2 came from routes/api.php. It now declares
the two global routes it needs, which states out loud what overriding
the global route means.
Nothing else in the suite changed. Same tests, same assertions, same
skips, before and after, on MySQL 8, MariaDB 11 and PostgreSQL:
mysql 128 tests, 260 assertions, 4 skipped (both)
mariadb 128 tests, 260 assertions, 4 skipped (both)
pgsql 128 tests, 209 assertions, 19 errors (both)
The PostgreSQL errors are pre-existing and unrelated.
This was referenced Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Swaps the test bootstrap for Orchestra Testbench. It touches only
require-devand the test suite — nosrc/changes, and nothing that reaches an application installing this package.Why
tests/Test.phpsearches three candidate paths for alaravel/laravelcheckout and requires itsbootstrap/app.php:That file is rewritten every major release, so the harness has to be rewritten alongside it. Laravel 11 is where it stops working entirely: the skeleton drops
app/Http/Kernel.phpandapp/Console/Kernel.php, andbootstrap/app.phpreturns the result ofApplication::configure(...)->create(). Whoever takes on Laravel 11 support has to solve this first, whatever else they change.Testbench ships the skeleton instead and tracks it release by release, which is what makes that future upgrade a version bump rather than another rewrite. It is also what a contributor to any other Laravel package expects to find, and
laravel/laravelleavesrequire-dev.What changed
tests/Test.phpextendsOrchestra\Testbench\TestCase. The hooks the suite already had are preserved —beforeSetUp(),duringSetUp(),$loadProviders— so no test had to change on account of the base class. The one rename ispathIdentified(string $path)→prepareSkeleton(string $path), since there is no longer a path to identify; it is now called fromdefineEnvironment(), which still runs before the providers boot, which is what that hook is for.Three tests reached into the skeleton directly:
RunCommandTestApp\Console\KernelIlluminate\Contracts\Console\Kernel, which is what it always wantedTenantAwareJobTestApp\Models\Userwebsite_idin the queue payload, so the notifiable no longer has to be a database model, and theuserstable stops being a dependencyRouteProviderTestThat last one is worth spelling out. The assertion was
assertEquals(2, $router->getRoutes()->count()), and the 2 came fromroutes/web.phpplusroutes/api.php. The tenant route does not add to the global one, it replaces it —RouteCollectionkeys by method and URI, so the secondGET /overwrites the first. The test was checking that without saying so. It now declares one global route the tenant file takes over and one that has to survive it, and the 2 means something.Verification
Same tests, same assertions, same skips, before and after —
5.xas it stands versus this branch, on the same database containers:The PostgreSQL errors are pre-existing and unrelated to this change: since PostgreSQL 15 a grant at the database level no longer allows creating tables in
public, so tenant provisioning fails. That one is fixed separately in #1054.Both halves of the
^9.0|^10.0range the package declares are covered, sinceorchestra/testbench ^7.0|^8.0follows the same split — Testbench 7 is Laravel 9, Testbench 8 is Laravel 10:laravel/framework v9.52.22laravel/framework v10.50.3The "before" column there is
5.xwithlaravel/laravelv9.5.2 and v10.3.3 respectively.One thing you may want to know
composer updateon5.xcurrently fails on a recent Composer, before any change of mine:Composer now refuses advisory-affected versions by default, and every Laravel 9 and 10 release carries at least one.
symfony/dom-crawler ~3.1is blocked the same way. I worked around it locally withcomposer config --global policy.advisories.block falserather than touchcomposer.jsonhere, since it is a separate concern from this PR. Aconfig.policy.advisories.ignore-idlist incomposer.jsonwould fix it properly if you want one.Happy to rebase or split this if you would rather take it in pieces.