You are here

protected function NodeTestBase::setUp in Drupal 10

Same name in this branch
  1. 10 core/modules/node/tests/src/Functional/NodeTestBase.php \Drupal\Tests\node\Functional\NodeTestBase::setUp()
  2. 10 core/modules/node/tests/src/Functional/Views/NodeTestBase.php \Drupal\Tests\node\Functional\Views\NodeTestBase::setUp()
Same name and namespace in other branches
  1. 8 core/modules/node/tests/src/Functional/NodeTestBase.php \Drupal\Tests\node\Functional\NodeTestBase::setUp()
  2. 9 core/modules/node/tests/src/Functional/NodeTestBase.php \Drupal\Tests\node\Functional\NodeTestBase::setUp()

File

core/modules/node/tests/src/Functional/NodeTestBase.php, line 32

Class

NodeTestBase
Sets up page and article content types.

Namespace

Drupal\Tests\node\Functional

Code

protected function setUp() : void {
  parent::setUp();

  // Create Basic page and Article node types.
  if ($this->profile != 'standard') {
    $this
      ->drupalCreateContentType([
      'type' => 'page',
      'name' => 'Basic page',
      'display_submitted' => FALSE,
    ]);
    $this
      ->drupalCreateContentType([
      'type' => 'article',
      'name' => 'Article',
    ]);
  }
  $this->accessHandler = \Drupal::entityTypeManager()
    ->getAccessControlHandler('node');
}