diff -u b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
--- b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
+++ b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
@@ -2,7 +2,6 @@
namespace Drupal\Tests\basic_auth\Functional;
-use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Url;
use Drupal\Tests\basic_auth\Traits\BasicAuthTestTrait;
use Drupal\language\Entity\ConfigurableLanguage;
diff -u b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
--- b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
@@ -71,7 +71,7 @@
$this->drupalPostForm('block/add/basic', $edit, t('Save'));
// Check that the Basic block has been created.
- $this->assertRaw('A custom block with block description ' . $edit['info[0][value]'] .' already exists.');
+ $this->assertRaw('A custom block with block description ' . $edit['info[0][value]'] . ' already exists.');
$this->assertResponse(200);
}
@@ -148,7 +148,7 @@
$this->drupalPostForm('block/add/basic', $edit, t('Save'));
// Check that the Basic block has been created.
- $this->assertRaw('A custom block with block description ' . $edit['info[0][value]'] .' already exists.');
+ $this->assertRaw('A custom block with block description ' . $edit['info[0][value]'] . ' already exists.');
$this->assertResponse(200);
}
diff -u b/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php
--- b/core/modules/book/tests/src/Functional/BookTest.php
+++ b/core/modules/book/tests/src/Functional/BookTest.php
@@ -201,7 +201,7 @@
* @param array $breadcrumb
* The nodes that should be displayed in the breadcrumb.
*/
- function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) {
+ public function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) {
// $number does not use drupal_static as it should not be reset
// since it uniquely identifies each call to checkBookNode().
static $number = 0;
@@ -209,17 +209,17 @@
// Check outline structure.
if ($nodes !== NULL) {
- $this->assertPattern($this->generateOutlinePattern($nodes), format_string('Node @number outline confirmed.', array('@number' => $number)));
+ $this->assertPattern($this->generateOutlinePattern($nodes), format_string('Node @number outline confirmed.', ['@number' => $number]));
}
else {
- $this->pass(format_string('Node %number does not have outline.', array('%number' => $number)));
+ $this->pass(format_string('Node %number does not have outline.', ['%number' => $number]));
}
// Check previous, up, and next links.
if ($previous) {
/** @var \Drupal\Core\Url $url */
$url = $previous->urlInfo();
- $url->setOptions(array('attributes' => array('rel' => array('prev'), 'title' => t('Go to previous page'))));
+ $url->setOptions(['attributes' => ['rel' => ['prev'], 'title' => t('Go to previous page')]]);
$unrendered_text = ['#markup' => '‹ ' . $previous->label()];
$rendered_text = \Drupal::service('renderer')->renderRoot($unrendered_text);
$this->assertRaw(\Drupal::l($rendered_text, $url), 'Previous page link found.');
@@ -228,21 +228,21 @@
if ($up) {
/** @var \Drupal\Core\Url $url */
$url = $up->urlInfo();
- $url->setOptions(array('attributes' => array('title' => t('Go to parent page'))));
+ $url->setOptions(['attributes' => ['title' => t('Go to parent page')]]);
$this->assertRaw(\Drupal::l('Up', $url), 'Up page link found.');
}
if ($next) {
/** @var \Drupal\Core\Url $url */
$url = $next->urlInfo();
- $url->setOptions(array('attributes' => array('rel' => array('next'), 'title' => t('Go to next page'))));
+ $url->setOptions(['attributes' => ['rel' => ['next'], 'title' => t('Go to next page')]]);
$unrendered_text = ['#markup' => $next->label() . ' ›'];
$rendered_text = \Drupal::service('renderer')->renderRoot($unrendered_text);
$this->assertRaw(\Drupal::l($rendered_text, $url), 'Next page link found.');
}
// Compute the expected breadcrumb.
- $expected_breadcrumb = array();
+ $expected_breadcrumb = [];
$expected_breadcrumb[] = \Drupal::url('');
foreach ($breadcrumb as $a_node) {
$expected_breadcrumb[] = $a_node->url();
@@ -250,7 +250,7 @@
// Fetch links in the current breadcrumb.
$links = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a');
- $got_breadcrumb = array();
+ $got_breadcrumb = [];
foreach ($links as $link) {
$got_breadcrumb[] = (string) $link['href'];
}
@@ -275,7 +275,7 @@
* @return string
* A regular expression that locates sub-nodes of the outline.
*/
- function generateOutlinePattern($nodes) {
+ public function generateOutlinePattern($nodes) {
$outline = '';
foreach ($nodes as $node) {
$outline .= '(node\/' . $node->id() . ')(.*?)(' . $node->label() . ')(.*?)';
@@ -295,12 +295,13 @@
* @return \Drupal\node\NodeInterface
* The created node.
*/
- function createBookNode($book_nid, $parent = NULL) {
+ public function createBookNode($book_nid, $parent = NULL) {
// $number does not use drupal_static as it should not be reset
// since it uniquely identifies each call to createBookNode().
- static $number = 0; // Used to ensure that when sorted nodes stay in same order.
+ // Used to ensure that when sorted nodes stay in same order.
+ static $number = 0;
- $edit = array();
+ $edit = [];
$edit['title[0][value]'] = str_pad($number, 2, '0', STR_PAD_LEFT) . ' - SimpleTest test node ' . $this->randomMachineName(10);
$edit['body[0][value]'] = 'SimpleTest test body ' . $this->randomMachineName(32) . ' ' . $this->randomMachineName(32);
$edit['book[bid]'] = $book_nid;
diff -u b/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
--- b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
@@ -3,7 +3,6 @@
namespace Drupal\Tests\config\Functional;
use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Config\InstallStorage;
use Drupal\Tests\BrowserTestBase;
diff -u b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
--- b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
@@ -2,7 +2,6 @@
namespace Drupal\Tests\contact\Functional;
-use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\PlainTextOutput;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Test\AssertMailTrait;
diff -u b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
--- b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
@@ -3,7 +3,6 @@
namespace Drupal\field\Tests\Boolean;
use Drupal\Component\Utility\Unicode;
-use Drupal\Component\Utility\SafeMarkup;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\simpletest\WebTestBase;
diff -u b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
--- b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
@@ -2,7 +2,6 @@
namespace Drupal\KernelTests\Core\Config;
-use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Uuid\Php;
use Drupal\Core\Config\ConfigImporter;
diff -u b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
--- b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
@@ -3,7 +3,6 @@
namespace Drupal\KernelTests\Core\Config;
use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Config\ConfigImporter;
use Drupal\Core\Config\ConfigImporterException;
use Drupal\Core\Config\StorageComparer;