mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 07:54:03 +00:00
### Test for DatabaseTenancyBootstrapper throwing an exception when
`DB_URL` is set
The test meant to cover this set `central.url` before creating a tenant.
That made the `CreateDatabase` job fail with a QueryException (it tried
to use the URL host as a database name). The bootstrapper's check was
never reached, and the exception that the test intended to cover wasn't
ever thrown in the end. The test passed for the wrong reason.
Fixed by creating the tenant first, setting the url only after that, and
asserting that `tenancy()->initialize()` throws the bootstrapper's
specific exception.
### Reference env variable that Laravel uses now (`DB_URL`) instead of
`DATABASE_URL`
Changed all `DATABASE_URL` references in Tenancy to `DB_URL`. [In
Laravel
11](
|
||
|---|---|---|
| .. | ||
| BootstrapperTest.php | ||
| BroadcastChannelPrefixBootstrapperTest.php | ||
| BroadcastingConfigBootstrapperTest.php | ||
| CacheTagsBootstrapperTest.php | ||
| CacheTenancyBootstrapperTest.php | ||
| DatabaseSessionBootstrapperTest.php | ||
| DatabaseTenancyBootstrapperTest.php | ||
| FilesystemTenancyBootstrapperTest.php | ||
| FortifyRouteBootstrapperTest.php | ||
| MailConfigBootstrapper.php | ||
| RootUrlBootstrapperTest.php | ||
| UrlGeneratorBootstrapperTest.php | ||