Skip to content
Snippets Groups Projects
Commit 35e4338a authored by Thalles Ferreira's avatar Thalles Ferreira Committed by Alexander Hass
Browse files

Issue #3074385 by thalles: Replace deprecated function format_string()

by new FormattableMarkup
parent 4f9c6125
No related branches found
No related tags found
No related merge requests found
......@@ -141,10 +141,10 @@ class LinkCheckerInterfaceTest extends WebTestBase {
]);
if ($link) {
$this->assertIdentical($link->url, $url1, format_string('URL %url found.', ['%url' => $url1]));
$this->assertIdentical($link->url, $url1, new FormattableMarkup('URL %url found.', ['%url' => $url1]));
}
else {
$this->fail(format_string('URL %url not found.', ['%url' => $url1]));
$this->fail(new FormattableMarkup('URL %url not found.', ['%url' => $url1]));
}
// Set link as failed once.
......@@ -201,14 +201,14 @@ class LinkCheckerInterfaceTest extends WebTestBase {
$link = \Drupal::entityTypeManager()
->getStorage('linkcheckerlink')
->loadByProperties([
'urlhash' => LinkCheckerLink::generateHash($url1)
'urlhash' => LinkCheckerLink::generateHash($url1),
]);
if ($link) {
$this->assertIdentical($link->url, $url1, format_string('URL %url found.', ['%url' => $url1]));
$this->assertIdentical($link->url, $url1, new FormattableMarkup('URL %url found.', ['%url' => $url1]));
}
else {
$this->fail(format_string('URL %url not found.', ['%url' => $url1]));
$this->fail(new FormattableMarkup('URL %url not found.', ['%url' => $url1]));
}
// Set link as failed once.
......
......@@ -324,10 +324,10 @@ EOT;
]);
if ($link) {
$this->assertIdentical($link->url, $check_url, format_string('Absolute URL %org_url matches expected result %check_url.', ['%org_url' => $org_url, '%check_url' => $check_url]));
$this->assertIdentical($link->url, $check_url, new FormattableMarkup('Absolute URL %org_url matches expected result %check_url.', ['%org_url' => $org_url, '%check_url' => $check_url]));
}
else {
$this->fail(format_string('URL %check_url not found.', ['%check_url' => $check_url]));
$this->fail(new FormattableMarkup('URL %check_url not found.', ['%check_url' => $check_url]));
}
}
......@@ -336,7 +336,7 @@ EOT;
// - Verifies that the linkchecker filter blacklist works well.
$urls_in_database = \Drupal::entityQuery('linkcheckerlink')->count()->execute();
$urls_expected_count = count($urls_fqdn);
$this->assertEquals($urls_in_database, $urls_expected_count, format_string('Found @urls_in_database URLs in database matches expected result of @urls_expected_count.', ['@urls_in_database' => $urls_in_database, '@urls_expected_count' => $urls_expected_count]));
$this->assertEquals($urls_in_database, $urls_expected_count, format_new FormattableMarkupstring('Found @urls_in_database URLs in database matches expected result of @urls_expected_count.', ['@urls_in_database' => $urls_in_database, '@urls_expected_count' => $urls_expected_count]));
// Extract all URLs including relative path.
// @FIXME
......@@ -389,17 +389,17 @@ EOT;
]);
if ($link) {
$this->assertIdentical($link->url, $check_url, format_string('Relative URL %org_url matches expected result %check_url.', ['%org_url' => $org_url, '%check_url' => $check_url]));
$this->assertIdentical($link->url, $check_url, new FormattableMarkup('Relative URL %org_url matches expected result %check_url.', ['%org_url' => $org_url, '%check_url' => $check_url]));
}
else {
$this->fail(format_string('URL %check_url not found.', ['%check_url' => $check_url]));
$this->fail(new FormattableMarkup('URL %check_url not found.', ['%check_url' => $check_url]));
}
}
// Check if the number of links is correct.
$urls_in_database = \Drupal::entityQuery('linkcheckerlink')->count()->execute();
$urls_expected_count = count($urls_fqdn + $urls_relative);
$this->assertEquals($urls_in_database, $urls_expected_count, format_string('Found @urls_in_database URLs in database matches expected result of @urls_expected_count.', ['@urls_in_database' => $urls_in_database, '@urls_expected_count' => $urls_expected_count]));
$this->assertEquals($urls_in_database, $urls_expected_count, new FormattableMarkup('Found @urls_in_database URLs in database matches expected result of @urls_expected_count.', ['@urls_in_database' => $urls_in_database, '@urls_expected_count' => $urls_expected_count]));
// Verify if link check has been enabled for normal URLs.
$urls = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment