function ContentEntityStorageBaseTest::testReCreate
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php \Drupal\KernelTests\Core\Entity\ContentEntityStorageBaseTest::testReCreate()
- 8.9.x core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php \Drupal\KernelTests\Core\Entity\ContentEntityStorageBaseTest::testReCreate()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php \Drupal\KernelTests\Core\Entity\ContentEntityStorageBaseTest::testReCreate()
@covers ::create
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ ContentEntityStorageBaseTest.php, line 55
Class
- ContentEntityStorageBaseTest
- @coversDefaultClass \Drupal\Core\Entity\ContentEntityStorageBase
Namespace
Drupal\KernelTests\Core\EntityCode
public function testReCreate() : void {
$storage = $this->container
->get('entity_type.manager')
->getStorage('entity_test');
$values = $storage->create([
'type' => 'test_bundle',
])
->toArray();
$entity = $storage->create($values);
$this->assertEquals('test_bundle', $entity->bundle());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.