function EntityBundleEntityTest::testWithBundleKeyEntity
Tests an entity type without the bundle entity key.
@covers ::getBundleEntity
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityBundleEntityTest.php, line 77
Class
- EntityBundleEntityTest
- Tests the getBundleEntity() method.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testWithBundleKeyEntity() : void {
$entity = EntityTestNoBundleWithLabel::create([
'name' => 'foo',
]);
$entity->save();
$this->assertNull($entity->getBundleEntity());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.