mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-02 17:14:53 +02:00
Fix user backend unit tests
Signed-off-by: Giuliano Mele <giuliano.mele@verdigado.com>
This commit is contained in:
parent
27a1a69b60
commit
5c0bec0280
|
@ -144,6 +144,17 @@ class UserBackendTest extends TestCase {
|
|||
->method('getDisplayName')
|
||||
->with('ExistingUser')
|
||||
->willReturn('');
|
||||
$user->expects($this->once())
|
||||
->method('getUID')
|
||||
->willReturn('ExistingUser');
|
||||
$this->groupManager
|
||||
->expects($this->once())
|
||||
->method('replaceGroups')
|
||||
->with('ExistingUser', []);
|
||||
$this->groupManager
|
||||
->expects($this->once())
|
||||
->method('evaluateGroupMigrations')
|
||||
->with([]);
|
||||
$this->userBackend->updateAttributes('ExistingUser', []);
|
||||
}
|
||||
|
||||
|
@ -216,12 +227,21 @@ class UserBackendTest extends TestCase {
|
|||
->expects($this->once())
|
||||
->method('setDisplayName')
|
||||
->with('ExistingUser', 'New Displayname');
|
||||
|
||||
$this->groupManager
|
||||
->expects($this->once())
|
||||
->method('replaceGroups')
|
||||
->with($user->getUID(), ['groupB', 'groupC']);
|
||||
|
||||
->with('ExistingUser', ['groupB', 'groupC']);
|
||||
$user->expects($this->once())
|
||||
->method('getUID')
|
||||
->willReturn('ExistingUser');
|
||||
$this->groupManager
|
||||
->expects($this->once())
|
||||
->method('evaluateGroupMigrations')
|
||||
->with(['groupB', 'groupC']);
|
||||
$this->groupManager
|
||||
->expects($this->once())
|
||||
->method('evaluateGroupMigrations')
|
||||
->with(['groupB', 'groupC']);
|
||||
$this->userBackend->updateAttributes('ExistingUser', [
|
||||
'email' => 'new@example.com',
|
||||
'displayname' => 'New Displayname',
|
||||
|
@ -287,6 +307,17 @@ class UserBackendTest extends TestCase {
|
|||
$this->eventDispatcher->expects($this->once())
|
||||
->method('dispatchTyped')
|
||||
->with(new UserChangedEvent($user, 'displayName', 'New Displayname', ''));
|
||||
$user->expects($this->once())
|
||||
->method('getUID')
|
||||
->willReturn('ExistingUser');
|
||||
$this->groupManager
|
||||
->expects($this->once())
|
||||
->method('replaceGroups')
|
||||
->with('ExistingUser', []);
|
||||
$this->groupManager
|
||||
->expects($this->once())
|
||||
->method('evaluateGroupMigrations')
|
||||
->with([]);
|
||||
$this->userBackend->updateAttributes('ExistingUser', ['email' => 'new@example.com', 'displayname' => 'New Displayname', 'quota' => '']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue