Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Config / ConfigImportRenameValidationTest.php
index 9c1875c85d201ab6f2ba22ffcc2711d409ff3985..f52b3956ab962d2a21dacf7fc0788aac8f39bae6 100644 (file)
@@ -2,8 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Config;
 
-use Drupal\Component\Utility\SafeMarkup;
-use Drupal\Component\Utility\Unicode;
+use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Component\Uuid\Php;
 use Drupal\Core\Config\ConfigImporter;
 use Drupal\Core\Config\ConfigImporterException;
@@ -40,7 +39,7 @@ class ConfigImportRenameValidationTest extends KernelTestBase {
 
     $this->installEntitySchema('user');
     $this->installEntitySchema('node');
-    $this->installConfig(['field']);
+    $this->installConfig(['system', 'field']);
 
     // Set up the ConfigImporter object for testing.
     $storage_comparer = new StorageComparer(
@@ -82,7 +81,7 @@ class ConfigImportRenameValidationTest extends KernelTestBase {
 
     // Create a content type with a matching UUID in the active storage.
     $content_type = NodeType::create([
-      'type' => Unicode::strtolower($this->randomMachineName(16)),
+      'type' => mb_strtolower($this->randomMachineName(16)),
       'name' => $this->randomMachineName(),
       'uuid' => $uuid,
     ]);
@@ -106,7 +105,7 @@ class ConfigImportRenameValidationTest extends KernelTestBase {
     catch (ConfigImporterException $e) {
       $this->pass('Expected ConfigImporterException thrown when a renamed configuration entity does not match the existing entity type.');
       $expected = [
-        SafeMarkup::format('Entity type mismatch on rename. @old_type not equal to @new_type for existing configuration @old_name and staged configuration @new_name.', ['@old_type' => 'node_type', '@new_type' => 'config_test', '@old_name' => 'node.type.' . $content_type->id(), '@new_name' => 'config_test.dynamic.' . $test_entity_id])
+        new FormattableMarkup('Entity type mismatch on rename. @old_type not equal to @new_type for existing configuration @old_name and staged configuration @new_name.', ['@old_type' => 'node_type', '@new_type' => 'config_test', '@old_name' => 'node.type.' . $content_type->id(), '@new_name' => 'config_test.dynamic.' . $test_entity_id]),
       ];
       $this->assertEqual($expected, $this->configImporter->getErrors());
     }
@@ -135,7 +134,7 @@ class ConfigImportRenameValidationTest extends KernelTestBase {
     // UUIDs match.
     $this->configImporter->reset();
     $expected = [
-      'config_test.old::config_test.new'
+      'config_test.old::config_test.new',
     ];
     $renames = $this->configImporter->getUnprocessedConfiguration('rename');
     $this->assertSame($expected, $renames);
@@ -149,7 +148,7 @@ class ConfigImportRenameValidationTest extends KernelTestBase {
     catch (ConfigImporterException $e) {
       $this->pass('Expected ConfigImporterException thrown when simple configuration is renamed.');
       $expected = [
-        SafeMarkup::format('Rename operation for simple configuration. Existing configuration @old_name and staged configuration @new_name.', ['@old_name' => 'config_test.old', '@new_name' => 'config_test.new'])
+        new FormattableMarkup('Rename operation for simple configuration. Existing configuration @old_name and staged configuration @new_name.', ['@old_name' => 'config_test.old', '@new_name' => 'config_test.new']),
       ];
       $this->assertEqual($expected, $this->configImporter->getErrors());
     }