diff --git a/core/modules/field/src/Tests/TestItemWithDependenciesTest.php b/core/modules/field/src/Tests/TestItemWithDependenciesTest.php new file mode 100644 index 0000000..a070338 --- /dev/null +++ b/core/modules/field/src/Tests/TestItemWithDependenciesTest.php @@ -0,0 +1,57 @@ + $this->field_name, + 'entity_type' => 'entity_test', + 'type' => 'test_field_with_dependencies', + ))->save(); + $field = entity_create('field_config', array( + 'entity_type' => 'entity_test', + 'field_name' => $this->field_name, + 'bundle' => 'entity_test', + )); + $field->save(); + + // Validate that the field configuration entity has the expected + // dependencies. + $this->assertEqual([ + 'content' => ['node:article:uuid'], + 'entity' => ['field.storage.entity_test.field_test'], + 'module' => ['field_test', 'test_module'] + ], $field->getDependencies()); + } + +} diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithDependencies.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithDependencies.php new file mode 100644 index 0000000..9e59399 --- /dev/null +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithDependencies.php @@ -0,0 +1,37 @@ + ['node:article:uuid']]; + } + +}