You are here

protected function PageNodeAccessTest::setUp in Page Manager 8.4

Overrides BrowserTestBase::setUp

File

tests/src/Functional/PageNodeAccessTest.php, line 38

Class

PageNodeAccessTest
Tests the access for an overridden route, specifically /node/{node}.

Namespace

Drupal\Tests\page_manager\Functional

Code

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

  // Remove the 'access content' permission from anonymous and auth users.
  Role::load(RoleInterface::ANONYMOUS_ID)
    ->revokePermission('access content')
    ->save();
  Role::load(RoleInterface::AUTHENTICATED_ID)
    ->revokePermission('access content')
    ->save();
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);
  $this
    ->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Page',
  ]);
  $this
    ->drupalPlaceBlock('page_title_block');
  $this->page = Page::load('node_view');
}