Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/UserTest.php
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | public function testUserDomains(): void | ||||
foreach ($user->domains() as $domain) { | foreach ($user->domains() as $domain) { | ||||
$domains[] = $domain->namespace; | $domains[] = $domain->namespace; | ||||
} | } | ||||
$this->assertContains('kolabnow.com', $domains); | $this->assertContains('kolabnow.com', $domains); | ||||
$this->assertContains('kolab.org', $domains); | $this->assertContains('kolab.org', $domains); | ||||
} | } | ||||
public function testUserQuota(): void | |||||
{ | |||||
$user = $this->getTestUser('john@kolab.org'); | |||||
$storage_sku = \App\Sku::where('title', 'storage')->first(); | |||||
$count = 0; | |||||
foreach ($user->entitlements()->get() as $entitlement) { | |||||
\Log::debug(var_export($entitlement, true)); | |||||
if ($entitlement->sku_id == $storage_sku->id) { | |||||
$count += 1; | |||||
} | |||||
} | |||||
$this->assertTrue($count == 2, "count is ${count}"); | |||||
} | |||||
/** | /** | ||||
* Tests for User::findByEmail() | * Tests for User::findByEmail() | ||||
*/ | */ | ||||
public function testFindByEmail(): void | public function testFindByEmail(): void | ||||
{ | { | ||||
$user = $this->getTestUser('john@kolab.org'); | $user = $this->getTestUser('john@kolab.org'); | ||||
$result = User::findByEmail('john'); | $result = User::findByEmail('john'); | ||||
Show All 13 Lines |