mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 22:24:03 +00:00
Adopt expectation API
This commit is contained in:
parent
5637018b0d
commit
cef9529d6a
22 changed files with 278 additions and 278 deletions
|
|
@ -36,8 +36,8 @@ test('tenant can be identified using hostname', function () {
|
|||
|
||||
$resolvedTenant = app(DomainTenantResolver::class)->resolve('foo.localhost');
|
||||
|
||||
$this->assertSame($id, $resolvedTenant->id);
|
||||
$this->assertSame(['foo.localhost'], $resolvedTenant->domains->pluck('domain')->toArray());
|
||||
expect($resolvedTenant->id)->toBe($id);
|
||||
expect($resolvedTenant->domains->pluck('domain')->toArray())->toBe(['foo.localhost']);
|
||||
});
|
||||
|
||||
test('a domain can belong to only one tenant', function () {
|
||||
|
|
@ -70,14 +70,14 @@ test('tenant can be identified by domain', function () {
|
|||
'domain' => 'foo.localhost',
|
||||
]);
|
||||
|
||||
$this->assertFalse(tenancy()->initialized);
|
||||
expect(tenancy()->initialized)->toBeFalse();
|
||||
|
||||
$this
|
||||
->get('http://foo.localhost/foo/abc/xyz')
|
||||
->assertSee('abc + xyz');
|
||||
|
||||
$this->assertTrue(tenancy()->initialized);
|
||||
$this->assertSame('acme', tenant('id'));
|
||||
expect(tenancy()->initialized)->toBeTrue();
|
||||
expect(tenant('id'))->toBe('acme');
|
||||
});
|
||||
|
||||
test('onfail logic can be customized', function () {
|
||||
|
|
@ -97,5 +97,5 @@ test('domains are always lowercase', function () {
|
|||
'domain' => 'CAPITALS',
|
||||
]);
|
||||
|
||||
$this->assertSame('capitals', Domain::first()->domain);
|
||||
expect(Domain::first()->domain)->toBe('capitals');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue