diff options
Diffstat (limited to 'tests/Core/Command/TwoFactorAuth/EnforceTest.php')
-rw-r--r-- | tests/Core/Command/TwoFactorAuth/EnforceTest.php | 45 |
1 files changed, 14 insertions, 31 deletions
diff --git a/tests/Core/Command/TwoFactorAuth/EnforceTest.php b/tests/Core/Command/TwoFactorAuth/EnforceTest.php index 194e16e8699..03118772377 100644 --- a/tests/Core/Command/TwoFactorAuth/EnforceTest.php +++ b/tests/Core/Command/TwoFactorAuth/EnforceTest.php @@ -3,25 +3,8 @@ 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 Tests\Core\Command\TwoFactorAuth; @@ -49,7 +32,7 @@ class EnforceTest extends TestCase { $this->command = new CommandTester($command); } - public function testEnforce() { + public function testEnforce(): void { $this->mandatoryTwoFactor->expects($this->once()) ->method('setState') ->with($this->equalTo(new EnforcementState(true))); @@ -63,10 +46,10 @@ class EnforceTest extends TestCase { $this->assertEquals(0, $rc); $display = $this->command->getDisplay(); - $this->assertStringContainsString("Two-factor authentication is enforced for all users", $display); + $this->assertStringContainsString('Two-factor authentication is enforced for all users', $display); } - public function testEnforceForOneGroup() { + public function testEnforceForOneGroup(): void { $this->mandatoryTwoFactor->expects($this->once()) ->method('setState') ->with($this->equalTo(new EnforcementState(true, ['twofactorers']))); @@ -81,10 +64,10 @@ class EnforceTest extends TestCase { $this->assertEquals(0, $rc); $display = $this->command->getDisplay(); - $this->assertStringContainsString("Two-factor authentication is enforced for members of the group(s) twofactorers", $display); + $this->assertStringContainsString('Two-factor authentication is enforced for members of the group(s) twofactorers', $display); } - public function testEnforceForAllExceptOneGroup() { + public function testEnforceForAllExceptOneGroup(): void { $this->mandatoryTwoFactor->expects($this->once()) ->method('setState') ->with($this->equalTo(new EnforcementState(true, [], ['yoloers']))); @@ -99,10 +82,10 @@ class EnforceTest extends TestCase { $this->assertEquals(0, $rc); $display = $this->command->getDisplay(); - $this->assertStringContainsString("Two-factor authentication is enforced for all users, except members of yoloers", $display); + $this->assertStringContainsString('Two-factor authentication is enforced for all users, except members of yoloers', $display); } - public function testDisableEnforced() { + public function testDisableEnforced(): void { $this->mandatoryTwoFactor->expects($this->once()) ->method('setState') ->with(new EnforcementState(false)); @@ -116,10 +99,10 @@ class EnforceTest extends TestCase { $this->assertEquals(0, $rc); $display = $this->command->getDisplay(); - $this->assertStringContainsString("Two-factor authentication is not enforced", $display); + $this->assertStringContainsString('Two-factor authentication is not enforced', $display); } - public function testCurrentStateEnabled() { + public function testCurrentStateEnabled(): void { $this->mandatoryTwoFactor->expects($this->once()) ->method('getState') ->willReturn(new EnforcementState(true)); @@ -128,10 +111,10 @@ class EnforceTest extends TestCase { $this->assertEquals(0, $rc); $display = $this->command->getDisplay(); - $this->assertStringContainsString("Two-factor authentication is enforced for all users", $display); + $this->assertStringContainsString('Two-factor authentication is enforced for all users', $display); } - public function testCurrentStateDisabled() { + public function testCurrentStateDisabled(): void { $this->mandatoryTwoFactor->expects($this->once()) ->method('getState') ->willReturn(new EnforcementState(false)); @@ -140,6 +123,6 @@ class EnforceTest extends TestCase { $this->assertEquals(0, $rc); $display = $this->command->getDisplay(); - $this->assertStringContainsString("Two-factor authentication is not enforced", $display); + $this->assertStringContainsString('Two-factor authentication is not enforced', $display); } } |