function BaseFieldOverrideTest::testGetClass
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php \Drupal\KernelTests\Core\Field\Entity\BaseFieldOverrideTest::testGetClass()
- 10 core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php \Drupal\KernelTests\Core\Field\Entity\BaseFieldOverrideTest::testGetClass()
- 11.x core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php \Drupal\KernelTests\Core\Field\Entity\BaseFieldOverrideTest::testGetClass()
@covers ::getClass
@dataProvider getClassTestCases
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Field/ Entity/ BaseFieldOverrideTest.php, line 41
Class
- BaseFieldOverrideTest
- @coversDefaultClass \Drupal\Core\Field\Entity\BaseFieldOverride @group Field
Namespace
Drupal\KernelTests\Core\Field\EntityCode
public function testGetClass($field_type, $base_field_class, $expected_override_class) {
$base_field = BaseFieldDefinition::create($field_type)->setName('Test Field')
->setTargetEntityTypeId('entity_test');
if ($base_field_class) {
$base_field->setClass($base_field_class);
}
$override = BaseFieldOverride::createFromBaseFieldDefinition($base_field, 'test_bundle');
$this->assertEquals($expected_override_class, ltrim($override->getClass(), '\\'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.