diff options
Diffstat (limited to 'tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php')
-rw-r--r-- | tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php index 0c85d0cf1ba..a1f2a6fa69a 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php @@ -3,29 +3,13 @@ declare(strict_types=1); /** - * @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2018 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace lib\Authentication\TwoFactorAuth; +use OC\Authentication\Exceptions\InvalidProviderException; use OC\Authentication\TwoFactorAuth\ProviderLoader; use OC\Authentication\TwoFactorAuth\ProviderManager; use OCP\Authentication\TwoFactorAuth\IActivatableByAdmin; @@ -37,7 +21,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class ProviderManagerTest extends TestCase { - /** @var ProviderLoader|MockObject */ private $providerLoader; @@ -59,15 +42,15 @@ class ProviderManagerTest extends TestCase { ); } - - public function testTryEnableInvalidProvider() { - $this->expectException(\OC\Authentication\Exceptions\InvalidProviderException::class); + + public function testTryEnableInvalidProvider(): void { + $this->expectException(InvalidProviderException::class); $user = $this->createMock(IUser::class); $this->providerManager->tryEnableProviderFor('none', $user); } - public function testTryEnableUnsupportedProvider() { + public function testTryEnableUnsupportedProvider(): void { $user = $this->createMock(IUser::class); $provider = $this->createMock(IProvider::class); $this->providerLoader->expects($this->once()) @@ -84,7 +67,7 @@ class ProviderManagerTest extends TestCase { $this->assertFalse($res); } - public function testTryEnableProvider() { + public function testTryEnableProvider(): void { $user = $this->createMock(IUser::class); $provider = $this->createMock(IActivatableByAdmin::class); $this->providerLoader->expects($this->once()) @@ -105,15 +88,15 @@ class ProviderManagerTest extends TestCase { $this->assertTrue($res); } - - public function testTryDisableInvalidProvider() { - $this->expectException(\OC\Authentication\Exceptions\InvalidProviderException::class); + + public function testTryDisableInvalidProvider(): void { + $this->expectException(InvalidProviderException::class); $user = $this->createMock(IUser::class); $this->providerManager->tryDisableProviderFor('none', $user); } - public function testTryDisableUnsupportedProvider() { + public function testTryDisableUnsupportedProvider(): void { $user = $this->createMock(IUser::class); $provider = $this->createMock(IProvider::class); $this->providerLoader->expects($this->once()) @@ -130,7 +113,7 @@ class ProviderManagerTest extends TestCase { $this->assertFalse($res); } - public function testTryDisableProvider() { + public function testTryDisableProvider(): void { $user = $this->createMock(IUser::class); $provider = $this->createMock(IDeactivatableByAdmin::class); $this->providerLoader->expects($this->once()) |