diff core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
line wrap: on
line diff
--- a/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -72,13 +72,6 @@
   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;
    *
    * @var \Drupal\Core\Field\FieldTypePluginManagerInterface|\PHPUnit_Framework_MockObject_MockObject
@@ -98,8 +91,6 @@
 
     $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 @@
     $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 @@
       'dependencies' => [
         'module' => [
           'fruiter',
-        ]
+        ],
       ],
       'third_party_settings' => [
         'fruiter' => [
           'fruit' => 'apple',
-        ]
-      ]
+        ],
+      ],
     ]);
     $changed = $field->onDependencyRemoval(['module' => ['fruiter']]);
     $this->assertTrue($changed);
@@ -299,9 +289,10 @@
       ->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);