function EntityOperationsTest::createNodeType
Same name in other branches
- 9 core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php \Drupal\Tests\content_moderation\Kernel\EntityOperationsTest::createNodeType()
- 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()
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 49
Class
- EntityOperationsTest
- @coversDefaultClass \Drupal\content_moderation\EntityOperations
Namespace
Drupal\Tests\content_moderation\KernelCode
protected function createNodeType() {
$node_type = NodeType::create([
'type' => 'page',
'name' => '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.