function BundleClassTest::testBundleClassShouldExtendEntityClass
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php \Drupal\KernelTests\Core\Entity\BundleClassTest::testBundleClassShouldExtendEntityClass()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php \Drupal\KernelTests\Core\Entity\BundleClassTest::testBundleClassShouldExtendEntityClass()
Checks exception thrown if a bundle class doesn't extend the entity class.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ BundleClassTest.php, line 265
Class
- BundleClassTest
- Tests entity bundle classes.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testBundleClassShouldExtendEntityClass() : void {
$this->container
->get('state')
->set('entity_test_bundle_class_non_inheriting', TRUE);
$this->entityTypeManager
->clearCachedDefinitions();
$this->expectException(BundleClassInheritanceException::class);
entity_test_create_bundle('bundle_class');
$this->storage
->create([
'type' => 'bundle_class',
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.