Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/UserTest.php
Show First 20 Lines • Show All 689 Lines • ▼ Show 20 Lines | public function testName(): void | ||||
$user->setSetting('last_name', 'Last'); | $user->setSetting('last_name', 'Last'); | ||||
$this->assertSame('First Last', $user->name()); | $this->assertSame('First Last', $user->name()); | ||||
$this->assertSame('First Last', $user->name(true)); | $this->assertSame('First Last', $user->name(true)); | ||||
} | } | ||||
/** | /** | ||||
* Test resources() method | |||||
*/ | |||||
public function testResources(): void | |||||
{ | |||||
$john = $this->getTestUser('john@kolab.org'); | |||||
$ned = $this->getTestUser('ned@kolab.org'); | |||||
$jack = $this->getTestUser('jack@kolab.org'); | |||||
$resources = $john->resources()->get(); | |||||
$this->assertSame(2, $resources->count()); | |||||
$resources = $ned->resources()->get(); | |||||
$this->assertSame(2, $resources->count()); | |||||
// TODO: More detailed assertions | |||||
$resources = $jack->resources()->get(); | |||||
$this->assertSame(0, $resources->count()); | |||||
} | |||||
/** | |||||
* Test user restoring | * Test user restoring | ||||
*/ | */ | ||||
public function testRestore(): void | public function testRestore(): void | ||||
{ | { | ||||
Queue::fake(); | Queue::fake(); | ||||
// Test an account with users and domain | // Test an account with users and domain | ||||
$userA = $this->getTestUser('UserAccountA@UserAccount.com', [ | $userA = $this->getTestUser('UserAccountA@UserAccount.com', [ | ||||
▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines |