Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / block / tests / src / Functional / BlockTest.php
similarity index 97%
rename from web/core/modules/block/src/Tests/BlockTest.php
rename to web/core/modules/block/tests/src/Functional/BlockTest.php
index 5910d4789a8b5fae074aec1fecf42495d279923f..7518c82dc136e7351421733889510c7829044f64 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\block\Tests;
+namespace Drupal\Tests\block\Functional;
 
 use Drupal\Component\Utility\Html;
 use Drupal\block\Entity\Block;
@@ -150,9 +150,9 @@ class BlockTest extends BlockTestBase {
       ]);
       $links = $this->xpath('//a[contains(@href, :href)]', [':href' => $add_url->toString()]);
       $this->assertEqual(1, count($links), 'Found one matching link.');
-      $this->assertEqual(t('Place block'), (string) $links[0], 'Found the expected link text.');
+      $this->assertEqual(t('Place block'), $links[0]->getText(), 'Found the expected link text.');
 
-      list($path, $query_string) = explode('?', $links[0]['href'], 2);
+      list($path, $query_string) = explode('?', $links[0]->getAttribute('href'), 2);
       parse_str($query_string, $query_parts);
       $this->assertEqual($weight, $query_parts['weight'], 'Found the expected weight query string.');
 
@@ -164,7 +164,7 @@ class BlockTest extends BlockTestBase {
         'settings[label]' => $title,
       ];
       // Create the block using the link parsed from the library page.
-      $this->drupalPostForm($this->getAbsoluteUrl($links[0]['href']), $edit, t('Save block'));
+      $this->drupalPostForm($this->getAbsoluteUrl($links[0]->getAttribute('href')), $edit, t('Save block'));
 
       // Ensure that the block was created with the expected weight.
       /** @var \Drupal\block\BlockInterface $block */
@@ -336,7 +336,7 @@ class BlockTest extends BlockTestBase {
     $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
 
     // Confirm that the block was moved to the proper region.
-    $this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', [ '%region_name' => $region]));
+    $this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', ['%region_name' => $region]));
 
     // Confirm that the block is being displayed.
     $this->drupalGet('');
@@ -379,7 +379,7 @@ class BlockTest extends BlockTestBase {
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT');
     $cid_parts = [\Drupal::url('<front>', [], ['absolute' => TRUE]), 'html'];
     $cid = implode(':', $cid_parts);
-    $cache_entry = \Drupal::cache('render')->get($cid);
+    $cache_entry = \Drupal::cache('page')->get($cid);
     $expected_cache_tags = [
       'config:block_list',
       'block_view',
@@ -420,7 +420,7 @@ class BlockTest extends BlockTestBase {
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT');
     $cid_parts = [\Drupal::url('<front>', [], ['absolute' => TRUE]), 'html'];
     $cid = implode(':', $cid_parts);
-    $cache_entry = \Drupal::cache('render')->get($cid);
+    $cache_entry = \Drupal::cache('page')->get($cid);
     $expected_cache_tags = [
       'config:block_list',
       'block_view',