Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / field / tests / src / Unit / FieldConfigEntityUnitTest.php
index b7dadf4926b11fccaaa9ea0ea17fa98362bd5cc0..10c0a7d9f5a6c77ccea109cf0b307b65ac83f5ea 100644 (file)
@@ -71,13 +71,6 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
    */
   protected $fieldStorage;
 
-  /**
-   * The typed configuration manager used for testing.
-   *
-   * @var \Drupal\Core\Config\TypedConfigManagerInterface|\PHPUnit_Framework_MockObject_MockObject
-   */
-  protected $typedConfigManager;
-
   /**
    * The mock field type plugin manager;
    *
@@ -98,8 +91,6 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
 
     $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
 
-    $this->typedConfigManager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface');
-
     $this->fieldTypePluginManager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
 
     $container = new ContainerBuilder();
@@ -107,7 +98,6 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
     $container->set('entity_field.manager', $this->entityFieldManager);
     $container->set('entity_type.manager', $this->entityTypeManager);
     $container->set('uuid', $this->uuid);
-    $container->set('config.typed', $this->typedConfigManager);
     $container->set('plugin.manager.field.field_type', $this->fieldTypePluginManager);
     // Inject the container into entity.manager so it can defer to
     // entity_type.manager, etc.
@@ -251,13 +241,13 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
       'dependencies' => [
         'module' => [
           'fruiter',
-        ]
+        ],
       ],
       'third_party_settings' => [
         'fruiter' => [
           'fruit' => 'apple',
-        ]
-      ]
+        ],
+      ],
     ]);
     $changed = $field->onDependencyRemoval(['module' => ['fruiter']]);
     $this->assertTrue($changed);
@@ -299,9 +289,10 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
       ->method('getKey')
       ->with('id')
       ->will($this->returnValue('id'));
-    $this->typedConfigManager->expects($this->once())
-      ->method('getDefinition')
-      ->will($this->returnValue(['mapping' => array_fill_keys(array_keys($expected), '')]));
+    $this->entityType->expects($this->once())
+      ->method('getPropertiesToExport')
+      ->with('test_entity_type.test_bundle.field_test')
+      ->will($this->returnValue(array_combine(array_keys($expected), array_keys($expected))));
 
     $export = $field->toArray();
     $this->assertEquals($expected, $export);