From 60d4b45e8924b2d8ccc2326a1f463ee9dae32905 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 8 Jan 2020 10:51:44 +0100 Subject: Clean up 2FA provider registry when a user is deleted Signed-off-by: Christoph Wurst --- tests/lib/Authentication/TwoFactorAuth/RegistryTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/lib/Authentication/TwoFactorAuth/RegistryTest.php') diff --git a/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php b/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php index 2f59d14992a..90fc4a9d27a 100644 --- a/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php @@ -108,6 +108,16 @@ class RegistryTest extends TestCase { $this->registry->disableProviderFor($provider, $user); } + public function testDeleteUserData() { + $user = $this->createMock(IUser::class); + $user->expects($this->once())->method('getUID')->willReturn('user123'); + $this->dao->expects($this->once()) + ->method('deleteByUser') + ->with('user123'); + + $this->registry->deleteUserData($user); + } + public function testCleanUp() { $this->dao->expects($this->once()) ->method('deleteAll') -- cgit v1.2.3