public function ConfigFieldDefinitionTest::testBundleFieldDefinition in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/field/src/Tests/ConfigFieldDefinitionTest.php \Drupal\field\Tests\ConfigFieldDefinitionTest::testBundleFieldDefinition()
Makes sure a field definition is exposed for a configurable field.
File
- core/
modules/ field/ src/ Tests/ ConfigFieldDefinitionTest.php, line 57 - Contains \Drupal\field\Tests\ConfigFieldDefinitionTest.
Class
- ConfigFieldDefinitionTest
- Tests exposing field definitions for configurable fields.
Namespace
Drupal\field\TestsCode
public function testBundleFieldDefinition() {
$definitions = $this->entityManager
->getFieldDefinitions($this->entityType, $this->bundle);
$this
->assertTrue(isset($definitions[$this->fieldTestData->field
->getName()]));
$this
->assertTrue($definitions[$this->fieldTestData->field
->getName()] instanceof FieldDefinitionInterface);
// Make sure fields on other entity types are not exposed.
$this
->assertFalse(isset($definitions[$this->fieldTestData->field_rev
->getName()]));
}