function ContentEntityStorageBaseTest::testCreate
Tests create.
@legacy-covers ::create
Attributes
#[DataProvider('providerTestCreate')]
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ ContentEntityStorageBaseTest.php, line 42
Class
Namespace
Drupal\KernelTests\Core\EntityCode
public function testCreate(string|array $bundle) : void {
$storage = $this->container
->get('entity_type.manager')
->getStorage('entity_test');
$entity = $storage->create([
'type' => $bundle,
]);
$this->assertEquals('test_bundle', $entity->bundle());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.