|
13 | 13 | use OC\Authentication\TwoFactorAuth\Registry; |
14 | 14 | use OCP\Authentication\TwoFactorAuth\IProvider; |
15 | 15 | use OCP\Authentication\TwoFactorAuth\IRegistry; |
| 16 | +use OCP\Authentication\TwoFactorAuth\IStatelessProvider; |
16 | 17 | use OCP\Authentication\TwoFactorAuth\RegistryEvent; |
17 | 18 | use OCP\Authentication\TwoFactorAuth\TwoFactorProviderDisabled; |
18 | 19 | use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered; |
@@ -76,6 +77,18 @@ public function testEnableProvider(): void { |
76 | 77 | $this->registry->enableProviderFor($provider, $user); |
77 | 78 | } |
78 | 79 |
|
| 80 | + public function testEnableStatelessProvider(): void { |
| 81 | + $user = $this->createMock(IUser::class); |
| 82 | + $provider = $this->createMock(IStatelessProvider::class); |
| 83 | + |
| 84 | + $this->dao->expects($this->never())->method('persist'); |
| 85 | + |
| 86 | + $this->dispatcher->expects($this->never())->method('dispatch'); |
| 87 | + $this->dispatcher->expects($this->never())->method('dispatchTyped'); |
| 88 | + |
| 89 | + $this->registry->enableProviderFor($provider, $user); |
| 90 | + } |
| 91 | + |
79 | 92 | public function testDisableProvider(): void { |
80 | 93 | $user = $this->createMock(IUser::class); |
81 | 94 | $provider = $this->createMock(IProvider::class); |
@@ -103,6 +116,18 @@ public function testDisableProvider(): void { |
103 | 116 | $this->registry->disableProviderFor($provider, $user); |
104 | 117 | } |
105 | 118 |
|
| 119 | + public function testDisableStatelessProvider(): void { |
| 120 | + $user = $this->createMock(IUser::class); |
| 121 | + $provider = $this->createMock(IStatelessProvider::class); |
| 122 | + |
| 123 | + $this->dao->expects($this->never())->method('persist'); |
| 124 | + |
| 125 | + $this->dispatcher->expects($this->never())->method('dispatch'); |
| 126 | + $this->dispatcher->expects($this->never())->method('dispatchTyped'); |
| 127 | + |
| 128 | + $this->registry->disableProviderFor($provider, $user); |
| 129 | + } |
| 130 | + |
106 | 131 | public function testDeleteUserData(): void { |
107 | 132 | $user = $this->createMock(IUser::class); |
108 | 133 | $user->expects($this->once())->method('getUID')->willReturn('user123'); |
|
0 commit comments