Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / field_ui / tests / src / Kernel / EntityDisplayTest.php
index 4a0e533be3a2ddff0b190e58a38b90ebeba39ac4..5ee2d406d28ecff0a3ef822cfd93d16c880ce833 100644 (file)
@@ -3,7 +3,6 @@
 namespace Drupal\Tests\field_ui\Kernel;
 
 use Drupal\Component\Render\FormattableMarkup;
-use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Entity\Display\EntityDisplayInterface;
@@ -87,7 +86,7 @@ class EntityDisplayTest extends KernelTestBase {
         'link_to_entity' => FALSE,
       ],
       'third_party_settings' => [],
-      'region' => 'content'
+      'region' => 'content',
     ];
     $this->assertEqual($display->getComponents(), $expected);
 
@@ -129,7 +128,7 @@ class EntityDisplayTest extends KernelTestBase {
     $display->save();
     $components = array_keys($display->getComponents());
     // The name field is not configurable so will be added automatically.
-    $expected = [ 0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name'];
+    $expected = [0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name'];
     $this->assertIdentical($components, $expected);
   }
 
@@ -150,7 +149,7 @@ class EntityDisplayTest extends KernelTestBase {
     $display = entity_get_display('entity_test', 'entity_test', 'default');
     $this->assertFalse($display->isNew());
     $this->assertEqual($display->id(), 'entity_test.entity_test.default');
-    $this->assertEqual($display->getComponent('component_1'), [ 'weight' => 10, 'settings' => [], 'third_party_settings' => [], 'region' => 'content']);
+    $this->assertEqual($display->getComponent('component_1'), ['weight' => 10, 'settings' => [], 'third_party_settings' => [], 'region' => 'content']);
   }
 
   /**
@@ -166,7 +165,15 @@ class EntityDisplayTest extends KernelTestBase {
 
     // Check that the default visibility taken into account for extra fields
     // unknown in the display.
-    $this->assertEqual($display->getComponent('display_extra_field'), ['weight' => 5, 'region' => 'content']);
+    $this->assertEqual(
+      $display->getComponent('display_extra_field'),
+      [
+        'weight' => 5,
+        'region' => 'content',
+        'settings' => [],
+        'third_party_settings' => [],
+      ]
+    );
     $this->assertNull($display->getComponent('display_extra_field_hidden'));
 
     // Check that setting explicit options overrides the defaults.
@@ -214,7 +221,7 @@ class EntityDisplayTest extends KernelTestBase {
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
-      'type' => 'test_field'
+      'type' => 'test_field',
     ]);
     $field_storage->save();
     $field = FieldConfig::create([
@@ -360,7 +367,7 @@ class EntityDisplayTest extends KernelTestBase {
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
-      'type' => 'test_field'
+      'type' => 'test_field',
     ]);
     $field_storage->save();
     $field = FieldConfig::create([
@@ -409,7 +416,7 @@ class EntityDisplayTest extends KernelTestBase {
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
-      'type' => 'text'
+      'type' => 'text',
     ]);
     $field_storage->save();
     $field = FieldConfig::create([
@@ -515,14 +522,14 @@ class EntityDisplayTest extends KernelTestBase {
     // Create two arbitrary user roles.
     for ($i = 0; $i < 2; $i++) {
       $roles[$i] = Role::create([
-        'id' => Unicode::strtolower($this->randomMachineName()),
+        'id' => mb_strtolower($this->randomMachineName()),
         'label' => $this->randomString(),
       ]);
       $roles[$i]->save();
     }
 
     // Create a field of type 'test_field' attached to 'entity_test'.
-    $field_name = Unicode::strtolower($this->randomMachineName());
+    $field_name = mb_strtolower($this->randomMachineName());
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',