diff --git a/admin/tool/behat/tests/manager_util_test.php b/admin/tool/behat/tests/manager_util_test.php index 71629550155e8..71b4b94575a69 100644 --- a/admin/tool/behat/tests/manager_util_test.php +++ b/admin/tool/behat/tests/manager_util_test.php @@ -165,7 +165,7 @@ public function test_get_config_file_contents_with_single_run() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } @@ -219,7 +219,7 @@ public function test_get_config_file_contents_with_single_run_no_theme() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } @@ -264,7 +264,7 @@ public function test_get_config_file_contents_with_parallel_run() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } @@ -295,7 +295,7 @@ public function test_get_config_file_contents_with_parallel_run() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } // Check contexts. @@ -324,7 +324,7 @@ public function test_get_config_file_contents_with_parallel_run() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } // Check contexts. @@ -368,7 +368,7 @@ public function test_get_config_file_contents_with_parallel_run_optimize_tags() $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } // Check contexts. @@ -399,7 +399,7 @@ public function test_get_config_file_contents_with_parallel_run_optimize_tags() $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } // Check contexts. @@ -428,7 +428,7 @@ public function test_get_config_file_contents_with_parallel_run_optimize_tags() $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } // Check contexts. @@ -532,7 +532,7 @@ public function test_get_config_file_contents_with_blacklisted_tags() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } // Check contexts. @@ -611,7 +611,7 @@ public function test_get_config_file_contents_with_blacklisted_features_contexts $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } // Check contexts. @@ -646,7 +646,7 @@ public function test_core_features_to_include_in_specified_theme() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } @@ -662,7 +662,7 @@ public function test_core_features_to_include_in_specified_theme() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } @@ -678,7 +678,7 @@ public function test_core_features_to_include_in_specified_theme() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } @@ -693,7 +693,7 @@ public function test_core_features_to_include_in_specified_theme() { $this->assertCount(count($paths), $suites[$themename]['paths']); foreach ($paths as $key => $feature) { - $this->assertContains($feature, $suites[$themename]['paths'][$key]); + $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]); } } } diff --git a/admin/tool/dataprivacy/tests/api_test.php b/admin/tool/dataprivacy/tests/api_test.php index 7bf94cc942060..4cb34501382f2 100644 --- a/admin/tool/dataprivacy/tests/api_test.php +++ b/admin/tool/dataprivacy/tests/api_test.php @@ -997,8 +997,8 @@ public function test_notify_dpo($byadmin, $type, $typestringid, $comments) { $this->assertEquals($subject, $message->subject); $this->assertEquals('tool_dataprivacy', $message->component); $this->assertEquals('contactdataprotectionofficer', $message->eventtype); - $this->assertContains(fullname($dpo), $message->fullmessage); - $this->assertContains(fullname($user1), $message->fullmessage); + $this->assertStringContainsString(fullname($dpo), $message->fullmessage); + $this->assertStringContainsString(fullname($user1), $message->fullmessage); } /** diff --git a/admin/tool/dataprivacy/tests/privacy_provider_test.php b/admin/tool/dataprivacy/tests/privacy_provider_test.php index e671fa73796e7..cfbaac3ce246b 100644 --- a/admin/tool/dataprivacy/tests/privacy_provider_test.php +++ b/admin/tool/dataprivacy/tests/privacy_provider_test.php @@ -142,7 +142,7 @@ public function test_export_user_data() { $this->assertEquals($strs->statusrejected, $data[1]->status); $this->assertEquals($strs->creationmanual, $data[1]->creationmethod); $this->assertEmpty($data[1]->comments); - $this->assertContains('Nope', $data[1]->dpocomment); + $this->assertStringContainsString('Nope', $data[1]->dpocomment); $this->assertNotEmpty($data[1]->timecreated); } @@ -184,4 +184,4 @@ public function test_export_user_preferences() { $this->assertEquals(6, $preferences[helper::PREF_REQUEST_PERPAGE]->value); } -} \ No newline at end of file +} diff --git a/admin/tool/httpsreplace/tests/httpsreplace_test.php b/admin/tool/httpsreplace/tests/httpsreplace_test.php index e3599c63cb967..fb60090e7e14b 100644 --- a/admin/tool/httpsreplace/tests/httpsreplace_test.php +++ b/admin/tool/httpsreplace/tests/httpsreplace_test.php @@ -155,7 +155,7 @@ public function test_upgrade_http_links($content, $ouputregex, $expectedcontent) $finder->upgrade_http_links(); $summary = $DB->get_field('course', 'summary', ['id' => $course->id]); - $this->assertContains($expectedcontent, $summary); + $this->assertStringContainsString($expectedcontent, $summary); } /** @@ -253,10 +253,10 @@ public function test_links_and_text() { $this->assertCount(0, $results); $summary = $DB->get_field('course', 'summary', ['id' => $course->id]); - $this->assertContains('http://intentionally.unavailable/page.php', $summary); - $this->assertContains('http://other.unavailable/page.php', $summary); - $this->assertNotContains('https://intentionally.unavailable', $summary); - $this->assertNotContains('https://other.unavailable', $summary); + $this->assertStringContainsString('http://intentionally.unavailable/page.php', $summary); + $this->assertStringContainsString('http://other.unavailable/page.php', $summary); + $this->assertStringNotContainsString('https://intentionally.unavailable', $summary); + $this->assertStringNotContainsString('https://other.unavailable', $summary); } /** @@ -281,7 +281,7 @@ public function test_httpwwwroot() { $finder->upgrade_http_links(); $summary = $DB->get_field('course', 'summary', ['id' => $course->id]); - $this->assertContains($CFG->wwwroot, $summary); + $this->assertStringContainsString($CFG->wwwroot, $summary); } /** @@ -298,10 +298,10 @@ public function test_upgrade_http_links_excluded_tables() { $output = ob_get_contents(); ob_end_clean(); $this->assertTrue($results); - $this->assertNotContains('https://somesite', $output); + $this->assertStringNotContainsString('https://somesite', $output); $testconf = get_config('core', 'test_upgrade_http_links'); - $this->assertContains('http://somesite', $testconf); - $this->assertNotContains('https://somesite', $testconf); + $this->assertStringContainsString('http://somesite', $testconf); + $this->assertStringNotContainsString('https://somesite', $testconf); } /** @@ -331,8 +331,8 @@ public function test_renames() { $finder->upgrade_http_links(); $summary = $DB->get_field('course', 'summary', ['id' => $course->id]); - $this->assertContains('https://secure.example.com', $summary); - $this->assertNotContains('http://example.com', $summary); + $this->assertStringContainsString('https://secure.example.com', $summary); + $this->assertStringNotContainsString('http://example.com', $summary); $this->assertEquals('