1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 19:34:04 +00:00

Refactor tests to use pest() helper

This commit is contained in:
Samuel Štancl 2022-07-23 01:16:50 +02:00
parent 05f2a828a1
commit f9c9d8615f
26 changed files with 128 additions and 127 deletions

View file

@ -47,14 +47,14 @@ test('a domain can belong to only one tenant', function () {
$tenant2 = DomainTenant::create();
$this->expectException(DomainOccupiedByOtherTenantException::class);
pest()->expectException(DomainOccupiedByOtherTenantException::class);
$tenant2->domains()->create([
'domain' => 'foo.localhost',
]);
});
test('an exception is thrown if tenant cannot be identified', function () {
$this->expectException(TenantCouldNotBeIdentifiedOnDomainException::class);
pest()->expectException(TenantCouldNotBeIdentifiedOnDomainException::class);
app(DomainTenantResolver::class)->resolve('foo.localhost');
});
@ -70,7 +70,7 @@ test('tenant can be identified by domain', function () {
expect(tenancy()->initialized)->toBeFalse();
$this
pest()
->get('http://foo.localhost/foo/abc/xyz')
->assertSee('abc + xyz');
@ -83,7 +83,7 @@ test('onfail logic can be customized', function () {
return 'foo';
};
$this
pest()
->get('http://foo.localhost/foo/abc/xyz')
->assertSee('foo');
});