function TrackerTest::setUp

Same name and namespace in other branches
  1. 7.x modules/tracker/tracker.test \TrackerTest::setUp()
  2. 9 core/modules/tracker/tests/src/Functional/TrackerTest.php \Drupal\Tests\tracker\Functional\TrackerTest::setUp()
  3. 8.9.x core/modules/tracker/tests/src/Functional/TrackerTest.php \Drupal\Tests\tracker\Functional\TrackerTest::setUp()
  4. 11.x core/modules/tracker/tests/src/Functional/TrackerTest.php \Drupal\Tests\tracker\Functional\TrackerTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/tracker/tests/src/Functional/TrackerTest.php, line 64

Class

TrackerTest
Create and delete nodes and check for their display in the tracker listings.

Namespace

Drupal\Tests\tracker\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Basic page',
  ]);
  $permissions = [
    'access comments',
    'create page content',
    'post comments',
    'skip comment approval',
  ];
  $this->user = $this->drupalCreateUser($permissions);
  $this->otherUser = $this->drupalCreateUser($permissions);
  $this->addDefaultCommentField('node', 'page');
  user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, [
    'access content',
    'access user profiles',
  ]);
  $this->drupalPlaceBlock('local_tasks_block', [
    'id' => 'page_tabs_block',
  ]);
  $this->drupalPlaceBlock('local_actions_block', [
    'id' => 'page_actions_block',
  ]);
}

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