You are here

protected function TrackerTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 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 58

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',
  ]);
}