mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:34:04 +00:00
convert test to pest and renamed
This commit is contained in:
parent
4714143dde
commit
0f7ab8a368
1 changed files with 12 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ use Stancl\Tenancy\Database\Models;
|
||||||
use Stancl\Tenancy\Database\Models\Domain;
|
use Stancl\Tenancy\Database\Models\Domain;
|
||||||
use Stancl\Tenancy\Exceptions\DomainOccupiedByOtherTenantException;
|
use Stancl\Tenancy\Exceptions\DomainOccupiedByOtherTenantException;
|
||||||
use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedOnDomainException;
|
use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedOnDomainException;
|
||||||
|
use Stancl\Tenancy\Features\UniversalRoutes;
|
||||||
use Stancl\Tenancy\Middleware\InitializeTenancyByDomain;
|
use Stancl\Tenancy\Middleware\InitializeTenancyByDomain;
|
||||||
use Stancl\Tenancy\Resolvers\DomainTenantResolver;
|
use Stancl\Tenancy\Resolvers\DomainTenantResolver;
|
||||||
|
|
||||||
|
|
@ -88,6 +89,17 @@ test('onfail logic can be customized', function () {
|
||||||
->assertSee('foo');
|
->assertSee('foo');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('throw correct exception when onFail is null and universal route is enabled', function () {
|
||||||
|
// un-define onFail logic
|
||||||
|
InitializeTenancyByDomain::$onFail = null;
|
||||||
|
|
||||||
|
// Enable UniversalRoute feature
|
||||||
|
Route::middlewareGroup('universal', []);
|
||||||
|
config(['tenancy.features' => [UniversalRoutes::class]]);
|
||||||
|
|
||||||
|
$this->withoutExceptionHandling()->get('http://foo.localhost/foo/abc/xyz');
|
||||||
|
})->throws(TenantCouldNotBeIdentifiedOnDomainException::class);;
|
||||||
|
|
||||||
test('domains are always lowercase', function () {
|
test('domains are always lowercase', function () {
|
||||||
$tenant = DomainTenant::create();
|
$tenant = DomainTenant::create();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue