public function FieldConfigEntityUnitTest::testGetType in Drupal 9
Same name and namespace in other branches
- 8 core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php \Drupal\Tests\field\Unit\FieldConfigEntityUnitTest::testGetType()
- 10 core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php \Drupal\Tests\field\Unit\FieldConfigEntityUnitTest::testGetType()
@covers ::getType
File
- core/
modules/ field/ tests/ src/ Unit/ FieldConfigEntityUnitTest.php, line 272 - Contains \Drupal\Tests\field\Unit\FieldConfigEntityUnitTest.
Class
- FieldConfigEntityUnitTest
- @coversDefaultClass \Drupal\field\Entity\FieldConfig @group field
Namespace
Drupal\Tests\field\UnitCode
public function testGetType() {
// Ensure that FieldConfig::getType() is not delegated to
// FieldStorage.
$this->entityFieldManager
->expects($this
->never())
->method('getFieldStorageDefinitions');
$this->fieldStorage
->expects($this
->never())
->method('getType');
$field = new FieldConfig([
'field_name' => $this->fieldStorage
->getName(),
'entity_type' => 'test_entity_type',
'bundle' => 'test_bundle',
'field_type' => 'test_field',
], $this->entityTypeId);
$this
->assertEquals('test_field', $field
->getType());
}