|
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; |
@@ -77,6 +78,18 @@ public function testEnableProvider(): void { |
77 | 78 | $this->registry->enableProviderFor($provider, $user); |
78 | 79 | } |
79 | 80 |
|
| 81 | + public function testEnableStatelessProvider(): void { |
| 82 | + $user = $this->createMock(IUser::class); |
| 83 | + $provider = $this->createMock(IStatelessProvider::class); |
| 84 | + |
| 85 | + $this->dao->expects($this->never())->method('persist'); |
| 86 | + |
| 87 | + $this->dispatcher->expects($this->never())->method('dispatch'); |
| 88 | + $this->dispatcher->expects($this->never())->method('dispatchTyped'); |
| 89 | + |
| 90 | + $this->registry->enableProviderFor($provider, $user); |
| 91 | + } |
| 92 | + |
80 | 93 | public function testDisableProvider(): void { |
81 | 94 | $user = $this->createMock(IUser::class); |
82 | 95 | $provider = $this->createMock(IProvider::class); |
@@ -104,6 +117,18 @@ public function testDisableProvider(): void { |
104 | 117 | $this->registry->disableProviderFor($provider, $user); |
105 | 118 | } |
106 | 119 |
|
| 120 | + public function testDisableStatelessProvider(): void { |
| 121 | + $user = $this->createMock(IUser::class); |
| 122 | + $provider = $this->createMock(IStatelessProvider::class); |
| 123 | + |
| 124 | + $this->dao->expects($this->never())->method('persist'); |
| 125 | + |
| 126 | + $this->dispatcher->expects($this->never())->method('dispatch'); |
| 127 | + $this->dispatcher->expects($this->never())->method('dispatchTyped'); |
| 128 | + |
| 129 | + $this->registry->disableProviderFor($provider, $user); |
| 130 | + } |
| 131 | + |
107 | 132 | public function testDeleteUserData(): void { |
108 | 133 | $user = $this->createMock(IUser::class); |
109 | 134 | $user->expects($this->once())->method('getUID')->willReturn('user123'); |
|
0 commit comments