diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2021-04-27 14:37:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 14:37:28 +0200 |
commit | c52a026f55c70bee22036d28dda01eae087e0c7a (patch) | |
tree | fbe17f895f7526629ee9375b39cf0f1d60c5c209 /tests | |
parent | bf1c875425e7fdf5ffd3c233ddf1f567428b4168 (diff) | |
parent | 83e10b7a736f7cfa9c933d0476b4784a062bb222 (diff) | |
download | nextcloud-server-c52a026f55c70bee22036d28dda01eae087e0c7a.tar.gz nextcloud-server-c52a026f55c70bee22036d28dda01eae087e0c7a.zip |
Merge pull request #26572 from nextcloud/bugfix/noid/throw-401-when-authentication-is-provided-and-invalid
Throw "401 Unauthenticated" when authentication is provided but invalid
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php b/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php index 1b813b5f36b..d9c565a3f6d 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php @@ -32,15 +32,16 @@ use OC\AppFramework\Bootstrap\ServiceRegistration; use OC\Authentication\TwoFactorAuth\ProviderLoader; use OCP\App\IAppManager; use OCP\Authentication\TwoFactorAuth\IProvider; +use OCP\IUser; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class ProviderLoaderTest extends TestCase { - /** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IAppManager|MockObject */ private $appManager; - /** @var \OCP\IUser|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IUser|MockObject */ private $user; /** @var RegistrationContext|MockObject */ @@ -53,7 +54,7 @@ class ProviderLoaderTest extends TestCase { parent::setUp(); $this->appManager = $this->createMock(IAppManager::class); - $this->user = $this->createMock(\OCP\IUser::class); + $this->user = $this->createMock(IUser::class); $this->registrationContext = $this->createMock(RegistrationContext::class); $coordinator = $this->createMock(Coordinator::class); @@ -123,7 +124,7 @@ class ProviderLoaderTest extends TestCase { ->with($this->user) ->willReturn([]); - $this->registrationContext->method('getTwoFactorProvider') + $this->registrationContext->method('getTwoFactorProviders') ->willReturn([ new ServiceRegistration('twofactor_test', '\\OCA\\TwoFactorTest\\Provider') ]); |