Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Backends/LDAPTest.php
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | public function testUser(): void | ||||
// Delete the user | // Delete the user | ||||
LDAP::deleteUser($user); | LDAP::deleteUser($user); | ||||
$this->assertSame(null, LDAP::getUser($user->email)); | $this->assertSame(null, LDAP::getUser($user->email)); | ||||
} | } | ||||
/** | /** | ||||
* Test handling errors on user creation | |||||
* | |||||
* @group ldap | |||||
*/ | |||||
public function testCreateUserException(): void | |||||
{ | |||||
$this->expectException(\Exception::class); | |||||
$this->expectExceptionMessageMatches('/Failed to create user/'); | |||||
$user = new User([ | |||||
'email' => 'test-non-existing-ldap@non-existing.org', | |||||
'status' => User::STATUS_ACTIVE, | |||||
]); | |||||
LDAP::createUser($user); | |||||
} | |||||
/** | |||||
* Test handling update of a non-existing domain | * Test handling update of a non-existing domain | ||||
* | * | ||||
* @group ldap | * @group ldap | ||||
*/ | */ | ||||
public function testUpdateDomainException(): void | public function testUpdateDomainException(): void | ||||
{ | { | ||||
$this->expectException(\Exception::class); | $this->expectException(\Exception::class); | ||||
$this->expectExceptionMessageMatches('/domain not found/'); | $this->expectExceptionMessageMatches('/domain not found/'); | ||||
Show All 28 Lines |