public function ContentEntityStorageBaseTest::testCreate in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php \Drupal\KernelTests\Core\Entity\ContentEntityStorageBaseTest::testCreate()
@covers ::create
@dataProvider providerTestCreate
File
- core/
tests/ Drupal/ KernelTests/ Core/ Entity/ ContentEntityStorageBaseTest.php, line 34
Class
- ContentEntityStorageBaseTest
- @coversDefaultClass \Drupal\Core\Entity\ContentEntityStorageBase
Namespace
Drupal\KernelTests\Core\EntityCode
public function testCreate($bundle) {
$storage = $this->container
->get('entity_type.manager')
->getStorage('entity_test');
$entity = $storage
->create([
'type' => $bundle,
]);
$this
->assertEquals('test_bundle', $entity
->bundle());
}