Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/UserTest.php
Show First 20 Lines • Show All 349 Lines • ▼ Show 20 Lines | public function testDomains(): void | ||||
$domain->save(); | $domain->save(); | ||||
$domains = collect($user->domains())->pluck('namespace')->all(); | $domains = collect($user->domains())->pluck('namespace')->all(); | ||||
$this->assertNotContains($domain->namespace, $domains); | $this->assertNotContains($domain->namespace, $domains); | ||||
} | } | ||||
/** | /** | ||||
* Test User::getConfig() and setConfig() methods | |||||
*/ | |||||
public function testConfigTrait(): void | |||||
{ | |||||
$john = $this->getTestUser('john@kolab.org'); | |||||
$john->setSetting('greylist_enabled', null); | |||||
$this->assertSame(['greylist_enabled' => true], $john->getConfig()); | |||||
$result = $john->setConfig(['greylist_enabled' => false, 'unknown' => false]); | |||||
$this->assertSame(['greylist_enabled' => false], $john->getConfig()); | |||||
$this->assertSame('false', $john->getSetting('greylist_enabled')); | |||||
$result = $john->setConfig(['greylist_enabled' => true]); | |||||
$this->assertSame(['greylist_enabled' => true], $john->getConfig()); | |||||
$this->assertSame('true', $john->getSetting('greylist_enabled')); | |||||
} | |||||
/** | |||||
* Test User::hasSku() method | * Test User::hasSku() method | ||||
*/ | */ | ||||
public function testHasSku(): void | public function testHasSku(): void | ||||
{ | { | ||||
$john = $this->getTestUser('john@kolab.org'); | $john = $this->getTestUser('john@kolab.org'); | ||||
$this->assertTrue($john->hasSku('mailbox')); | $this->assertTrue($john->hasSku('mailbox')); | ||||
$this->assertTrue($john->hasSku('storage')); | $this->assertTrue($john->hasSku('storage')); | ||||
▲ Show 20 Lines • Show All 584 Lines • Show Last 20 Lines |