protected function CreateSampleEntityTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Entity/CreateSampleEntityTest.php \Drupal\KernelTests\Core\Entity\CreateSampleEntityTest::setUp()
Overrides KernelTestBase::setUp
File
- core/
tests/ Drupal/ KernelTests/ Core/ Entity/ CreateSampleEntityTest.php, line 44
Class
- CreateSampleEntityTest
- Tests the ContentEntityStorageBase::createWithSampleValues method.
Namespace
Drupal\KernelTests\Core\EntityCode
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('file');
$this
->installEntitySchema('user');
$this
->installEntitySchema('node');
$this
->installEntitySchema('node_type');
$this
->installEntitySchema('comment');
$this
->installEntitySchema('comment_type');
$this
->installEntitySchema('path_alias');
$this
->installEntitySchema('taxonomy_vocabulary');
$this
->installEntitySchema('taxonomy_term');
$this->entityTypeManager = $this->container
->get('entity_type.manager');
NodeType::create([
'type' => 'article',
'name' => 'Article',
])
->save();
NodeType::create([
'type' => 'page',
'name' => 'Page',
])
->save();
Vocabulary::create([
'name' => 'Tags',
'vid' => 'tags',
])
->save();
}