Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-23 14:36:32 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-07-23 23:26:44 +0300
commit1d290e15e869d0bd2f9b6f90650641c4acbb7677 (patch)
tree2baa8b374e1faac52b9cf2519b1f6ca5c115dabd /tests
parent4570534fed2108a094c074e55cd877c591dcf8a8 (diff)
Use assertStringContainsString instead of assertContains on strings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests')
-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
-rw-r--r--tests/lib/AppFramework/Http/DownloadResponseTest.php4
6 files changed, 18 insertions, 18 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);
}
}
diff --git a/tests/lib/AppFramework/Http/DownloadResponseTest.php b/tests/lib/AppFramework/Http/DownloadResponseTest.php
index 1ad53f5db13..6c509b8bc59 100644
--- a/tests/lib/AppFramework/Http/DownloadResponseTest.php
+++ b/tests/lib/AppFramework/Http/DownloadResponseTest.php
@@ -45,7 +45,7 @@ class DownloadResponseTest extends \Test\TestCase {
public function testHeaders() {
$headers = $this->response->getHeaders();
- $this->assertContains('attachment; filename="file"', $headers['Content-Disposition']);
- $this->assertContains('content', $headers['Content-Type']);
+ $this->assertStringContainsString('attachment; filename="file"', $headers['Content-Disposition']);
+ $this->assertStringContainsString('content', $headers['Content-Type']);
}
}