summaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-23 13:36:32 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-07-23 17:11:29 +0200
commit0123cd0ae345ae6c90955ea79331a48f7c5cf95d (patch)
tree55d14965b30c6bf23cd200c26ec663a93767f910 /tests/Core
parentf8955bd0d1fe3e51d88831bc4f4c934bdef1256a (diff)
downloadnextcloud-server-0123cd0ae345ae6c90955ea79331a48f7c5cf95d.tar.gz
nextcloud-server-0123cd0ae345ae6c90955ea79331a48f7c5cf95d.zip
Use assertStringContainsString instead of assertContains on strings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Command/TwoFactorAuth/CleanupTest.php2
-rw-r--r--tests/Core/Command/TwoFactorAuth/DisableTest.php6
-rw-r--r--tests/Core/Command/TwoFactorAuth/EnableTest.php6
-rw-r--r--tests/Core/Command/TwoFactorAuth/EnforceTest.php12
-rw-r--r--tests/Core/Command/TwoFactorAuth/StateTest.php6
5 files changed, 16 insertions, 16 deletions
diff --git a/tests/Core/Command/TwoFactorAuth/CleanupTest.php b/tests/Core/Command/TwoFactorAuth/CleanupTest.php
index 98425aee223..75e869ad06f 100644
--- a/tests/Core/Command/TwoFactorAuth/CleanupTest.php
+++ b/tests/Core/Command/TwoFactorAuth/CleanupTest.php
@@ -60,6 +60,6 @@ class CleanupTest extends TestCase {
$this->assertEquals(0, $rc);
$output = $this->cmd->getDisplay();
- $this->assertContains("All user-provider associations for provider u2f have been removed", $output);
+ $this->assertStringContainsString("All user-provider associations for provider u2f have been removed", $output);
}
}
diff --git a/tests/Core/Command/TwoFactorAuth/DisableTest.php b/tests/Core/Command/TwoFactorAuth/DisableTest.php
index fc0def50b90..5accaccb907 100644
--- a/tests/Core/Command/TwoFactorAuth/DisableTest.php
+++ b/tests/Core/Command/TwoFactorAuth/DisableTest.php
@@ -67,7 +67,7 @@ class DisableTest extends TestCase {
]);
$this->assertEquals(1, $rc);
- $this->assertContains("Invalid UID", $this->command->getDisplay());
+ $this->assertStringContainsString("Invalid UID", $this->command->getDisplay());
}
public function testEnableNotSupported() {
@@ -87,7 +87,7 @@ class DisableTest extends TestCase {
]);
$this->assertEquals(2, $rc);
- $this->assertContains("The provider does not support this operation", $this->command->getDisplay());
+ $this->assertStringContainsString("The provider does not support this operation", $this->command->getDisplay());
}
public function testEnabled() {
@@ -107,6 +107,6 @@ class DisableTest extends TestCase {
]);
$this->assertEquals(0, $rc);
- $this->assertContains("Two-factor provider totp disabled for user ricky", $this->command->getDisplay());
+ $this->assertStringContainsString("Two-factor provider totp disabled for user ricky", $this->command->getDisplay());
}
}
diff --git a/tests/Core/Command/TwoFactorAuth/EnableTest.php b/tests/Core/Command/TwoFactorAuth/EnableTest.php
index f3b66912f43..fc71cc32148 100644
--- a/tests/Core/Command/TwoFactorAuth/EnableTest.php
+++ b/tests/Core/Command/TwoFactorAuth/EnableTest.php
@@ -67,7 +67,7 @@ class EnableTest extends TestCase {
]);
$this->assertEquals(1, $rc);
- $this->assertContains("Invalid UID", $this->command->getDisplay());
+ $this->assertStringContainsString("Invalid UID", $this->command->getDisplay());
}
public function testEnableNotSupported() {
@@ -87,7 +87,7 @@ class EnableTest extends TestCase {
]);
$this->assertEquals(2, $rc);
- $this->assertContains("The provider does not support this operation", $this->command->getDisplay());
+ $this->assertStringContainsString("The provider does not support this operation", $this->command->getDisplay());
}
public function testEnabled() {
@@ -107,6 +107,6 @@ class EnableTest extends TestCase {
]);
$this->assertEquals(0, $rc);
- $this->assertContains("Two-factor provider totp enabled for user belle", $this->command->getDisplay());
+ $this->assertStringContainsString("Two-factor provider totp enabled for user belle", $this->command->getDisplay());
}
}
diff --git a/tests/Core/Command/TwoFactorAuth/EnforceTest.php b/tests/Core/Command/TwoFactorAuth/EnforceTest.php
index 48c09f7e639..ed3deaa3fb3 100644
--- a/tests/Core/Command/TwoFactorAuth/EnforceTest.php
+++ b/tests/Core/Command/TwoFactorAuth/EnforceTest.php
@@ -64,7 +64,7 @@ class EnforceTest extends TestCase {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is enforced for all users", $display);
+ $this->assertStringContainsString("Two-factor authentication is enforced for all users", $display);
}
public function testEnforceForOneGroup() {
@@ -82,7 +82,7 @@ class EnforceTest extends TestCase {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("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() {
@@ -100,7 +100,7 @@ class EnforceTest extends TestCase {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("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() {
@@ -117,7 +117,7 @@ class EnforceTest extends TestCase {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is not enforced", $display);
+ $this->assertStringContainsString("Two-factor authentication is not enforced", $display);
}
public function testCurrentStateEnabled() {
@@ -129,7 +129,7 @@ class EnforceTest extends TestCase {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is enforced for all users", $display);
+ $this->assertStringContainsString("Two-factor authentication is enforced for all users", $display);
}
public function testCurrentStateDisabled() {
@@ -141,6 +141,6 @@ class EnforceTest extends TestCase {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is not enforced", $display);
+ $this->assertStringContainsString("Two-factor authentication is not enforced", $display);
}
}
diff --git a/tests/Core/Command/TwoFactorAuth/StateTest.php b/tests/Core/Command/TwoFactorAuth/StateTest.php
index ce52bcf2751..54ab85b51b8 100644
--- a/tests/Core/Command/TwoFactorAuth/StateTest.php
+++ b/tests/Core/Command/TwoFactorAuth/StateTest.php
@@ -61,7 +61,7 @@ class StateTest extends TestCase {
]);
$output = $this->cmd->getDisplay();
- $this->assertContains("Invalid UID", $output);
+ $this->assertStringContainsString("Invalid UID", $output);
}
public function testStateNoProvidersActive() {
@@ -84,7 +84,7 @@ class StateTest extends TestCase {
]);
$output = $this->cmd->getDisplay();
- $this->assertContains("Two-factor authentication is not enabled for user eldora", $output);
+ $this->assertStringContainsString("Two-factor authentication is not enabled for user eldora", $output);
}
public function testStateOneProviderActive() {
@@ -107,6 +107,6 @@ class StateTest extends TestCase {
]);
$output = $this->cmd->getDisplay();
- $this->assertContains("Two-factor authentication is enabled for user mohamed", $output);
+ $this->assertStringContainsString("Two-factor authentication is enabled for user mohamed", $output);
}
}