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

Test cleanup

This commit is contained in:
Samuel Štancl 2019-09-19 22:04:52 +02:00
parent 97d1fc87a2
commit 25927c36bd
2 changed files with 4 additions and 4 deletions

View file

@ -147,7 +147,7 @@ class TenantManagerTest extends TestCase
{
$tenant1 = Tenant::new()->withDomains(['foo.localhost'])->save();
$tenant2 = Tenant::new()->withDomains(['bar.localhost'])->save();
$this->assertEquals([$tenant1, $tenant2], tenancy()->all()->toArray());
$this->assertEqualsCanonicalizing([$tenant1, $tenant2], tenancy()->all()->toArray());
}
/** @test */

View file

@ -16,9 +16,9 @@ class TenantStorageTest extends TestCase
{
$abc = Tenant::new()->withDomains(['abc.localhost'])->save();
$exists = function () use ($abc) {
return tenancy()->all()->reduce(function ($result, $tenant) use ($abc) {
return $result ?: $tenant->id === $abc->id;
}, false);
return tenancy()->all()->contains(function ($tenant) use ($abc) {
return $tenant->id === $abc->id;
});
};
$this->assertTrue($exists());