function NodeConditionTest::setUp

Same name in other branches
  1. 8.9.x core/modules/node/tests/src/Kernel/NodeConditionTest.php \Drupal\Tests\node\Kernel\NodeConditionTest::setUp()

Overrides EntityKernelTestBase::setUp

File

core/modules/node/tests/src/Kernel/NodeConditionTest.php, line 22

Class

NodeConditionTest
Tests that conditions, provided by the node module, are working properly.

Namespace

Drupal\Tests\node\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    // Create the node bundles required for testing.
    $type = NodeType::create([
        'type' => 'page',
        'name' => 'page',
    ]);
    $type->save();
    $type = NodeType::create([
        'type' => 'article',
        'name' => 'article',
    ]);
    $type->save();
    $type = NodeType::create([
        'type' => 'test',
        'name' => 'test',
    ]);
    $type->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.