mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:14:04 +00:00
Test cleanup
This commit is contained in:
parent
97d1fc87a2
commit
25927c36bd
2 changed files with 4 additions and 4 deletions
|
|
@ -147,7 +147,7 @@ class TenantManagerTest extends TestCase
|
||||||
{
|
{
|
||||||
$tenant1 = Tenant::new()->withDomains(['foo.localhost'])->save();
|
$tenant1 = Tenant::new()->withDomains(['foo.localhost'])->save();
|
||||||
$tenant2 = Tenant::new()->withDomains(['bar.localhost'])->save();
|
$tenant2 = Tenant::new()->withDomains(['bar.localhost'])->save();
|
||||||
$this->assertEquals([$tenant1, $tenant2], tenancy()->all()->toArray());
|
$this->assertEqualsCanonicalizing([$tenant1, $tenant2], tenancy()->all()->toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ class TenantStorageTest extends TestCase
|
||||||
{
|
{
|
||||||
$abc = Tenant::new()->withDomains(['abc.localhost'])->save();
|
$abc = Tenant::new()->withDomains(['abc.localhost'])->save();
|
||||||
$exists = function () use ($abc) {
|
$exists = function () use ($abc) {
|
||||||
return tenancy()->all()->reduce(function ($result, $tenant) use ($abc) {
|
return tenancy()->all()->contains(function ($tenant) use ($abc) {
|
||||||
return $result ?: $tenant->id === $abc->id;
|
return $tenant->id === $abc->id;
|
||||||
}, false);
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->assertTrue($exists());
|
$this->assertTrue($exists());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue