You are here

protected function PanelizerIntegrationTest::setUp in Panelizer 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/PanelizerIntegrationTest.php \Drupal\Tests\panelizer\FunctionalJavascript\PanelizerIntegrationTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/FunctionalJavascript/PanelizerIntegrationTest.php, line 47

Class

PanelizerIntegrationTest
Tests the JavaScript functionality of Panels IPE with Panelizer.

Namespace

Drupal\Tests\panelizer\FunctionalJavascript

Code

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

  // Create a user with appropriate permissions to use Panels IPE.
  $admin_user = $this
    ->drupalCreateUser([
    'access content',
    'access panels in-place editing',
    'administer blocks',
    'administer content types',
    'administer nodes',
    'administer node display',
    'administer panelizer',
  ]);
  $this
    ->drupalLogin($admin_user);

  // Create the "Basic Page" content type.
  $this
    ->createContentType([
    'type' => 'page',
    'name' => 'Basic Page',
  ]);

  // Enable Panelizer for the "Basic Page" content type.
  $this
    ->drupalGet('admin/structure/types/manage/page/display');
  $this
    ->submitForm([
    'panelizer[enable]' => 1,
  ], t('Save'));

  // Create a new Basic Page.
  $this
    ->drupalGet('node/add/page');
  $this
    ->submitForm([
    'title[0][value]' => 'Test Node',
  ], t('Save'));
  $this->test_route = 'node/1';
}