Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/UsersTest.php
Show First 20 Lines • Show All 730 Lines • ▼ Show 20 Lines | public function testStore(): void | ||||
$this->assertSame("User created successfully.", $json['message']); | $this->assertSame("User created successfully.", $json['message']); | ||||
$this->assertCount(2, $json); | $this->assertCount(2, $json); | ||||
$user = User::where('email', 'john2.doe2@kolab.org')->first(); | $user = User::where('email', 'john2.doe2@kolab.org')->first(); | ||||
$this->assertInstanceOf(User::class, $user); | $this->assertInstanceOf(User::class, $user); | ||||
$this->assertSame('John2', $user->getSetting('first_name')); | $this->assertSame('John2', $user->getSetting('first_name')); | ||||
$this->assertSame('Doe2', $user->getSetting('last_name')); | $this->assertSame('Doe2', $user->getSetting('last_name')); | ||||
$this->assertSame('TestOrg', $user->getSetting('organization')); | $this->assertSame('TestOrg', $user->getSetting('organization')); | ||||
/** @var \App\UserAlias[] $aliases */ | |||||
$aliases = $user->aliases()->orderBy('alias')->get(); | $aliases = $user->aliases()->orderBy('alias')->get(); | ||||
$this->assertCount(2, $aliases); | $this->assertCount(2, $aliases); | ||||
$this->assertSame('deleted@kolab.org', $aliases[0]->alias); | $this->assertSame('deleted@kolab.org', $aliases[0]->alias); | ||||
$this->assertSame('useralias1@kolab.org', $aliases[1]->alias); | $this->assertSame('useralias1@kolab.org', $aliases[1]->alias); | ||||
// Assert the new user entitlements | // Assert the new user entitlements | ||||
$this->assertEntitlements($user, ['groupware', 'mailbox', | $this->assertEntitlements($user, ['groupware', 'mailbox', | ||||
'storage', 'storage', 'storage', 'storage', 'storage']); | 'storage', 'storage', 'storage', 'storage', 'storage']); | ||||
// Assert the wallet to which the new user should be assigned to | // Assert the wallet to which the new user should be assigned to | ||||
▲ Show 20 Lines • Show All 762 Lines • Show Last 20 Lines |