protected function NodeAccessTest::setUp in Drupal 9
Same name in this branch
- 9 core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php \Drupal\Tests\content_moderation\Functional\NodeAccessTest::setUp()
- 9 core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php \Drupal\Tests\content_moderation\Kernel\NodeAccessTest::setUp()
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php \Drupal\Tests\content_moderation\Kernel\NodeAccessTest::setUp()
Overrides KernelTestBase::setUp
File
- core/
modules/ content_moderation/ tests/ src/ Kernel/ NodeAccessTest.php, line 45
Class
- NodeAccessTest
- Tests with node access enabled.
Namespace
Drupal\Tests\content_moderation\KernelCode
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('content_moderation_state');
$this
->installEntitySchema('node');
$this
->installEntitySchema('user');
$this
->installEntitySchema('workflow');
$this
->installConfig([
'content_moderation',
'filter',
]);
$this
->installSchema('system', [
'sequences',
]);
$this
->installSchema('node', [
'node_access',
]);
// Add a moderated node type.
$node_type = NodeType::create([
'type' => 'page',
'label' => 'Page',
]);
$node_type
->save();
$workflow = $this
->createEditorialWorkflow();
$workflow
->getTypePlugin()
->addEntityTypeAndBundle('node', 'page');
$workflow
->save();
$this->moderationInformation = \Drupal::service('content_moderation.moderation_information');
}