1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:54:05 +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

@ -35,7 +35,7 @@ test('tenant id is auto added to session if its missing', function () {
'id' => 'acme',
]);
$this->get('http://acme.localhost/foo')
pest()->get('http://acme.localhost/foo')
->assertSessionHas(ScopeSessions::$tenantIdKey, 'acme');
});
@ -44,12 +44,12 @@ test('changing tenant id in session will abort the request', function () {
'id' => 'acme',
]);
$this->get('http://acme.localhost/foo')
pest()->get('http://acme.localhost/foo')
->assertSuccessful();
session()->put(ScopeSessions::$tenantIdKey, 'foobar');
$this->get('http://acme.localhost/foo')
pest()->get('http://acme.localhost/foo')
->assertStatus(403);
});
@ -62,6 +62,6 @@ test('an exception is thrown when the middleware is executed before tenancy is i
'id' => 'acme',
]);
$this->expectException(TenancyNotInitializedException::class);
$this->withoutExceptionHandling()->get('http://acme.localhost/bar');
pest()->expectException(TenancyNotInitializedException::class);
pest()->withoutExceptionHandling()->get('http://acme.localhost/bar');
});