function EntityOperationsTest::createNodeType
Same name and namespace in other branches
- 8.9.x core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php \Drupal\Tests\content_moderation\Kernel\EntityOperationsTest::createNodeType()
- 10 core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php \Drupal\Tests\content_moderation\Kernel\EntityOperationsTest::createNodeType()
- 11.x core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php \Drupal\Tests\content_moderation\Kernel\EntityOperationsTest::createNodeType()
Creates a page node type to test with, ensuring that it's moderated.
1 call to EntityOperationsTest::createNodeType()
- EntityOperationsTest::setUp in core/
modules/ content_moderation/ tests/ src/ Kernel/ EntityOperationsTest.php
File
-
core/
modules/ content_moderation/ tests/ src/ Kernel/ EntityOperationsTest.php, line 47
Class
- EntityOperationsTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21content_moderation%21src%21EntityOperations.php/class/EntityOperations/9" title="Defines a class for reacting to entity events." class="local">\Drupal\content_moderation\EntityOperations</a>
Namespace
Drupal\Tests\content_moderation\KernelCode
protected function createNodeType() {
$node_type = NodeType::create([
'type' => 'page',
'label' => 'Page',
]);
$node_type->save();
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()
->addEntityTypeAndBundle('node', 'page');
$workflow->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.