You are here

protected function PanelizerIntegrationTest::setUp in Panels 8.3

Overrides BrowserTestBase::setUp

File

panels_ipe/tests/src/FunctionalJavascript/PanelizerIntegrationTest.php, line 35

Class

PanelizerIntegrationTest
Tests the JavaScript functionality of Panels IPE with Panelizer.

Namespace

Drupal\Tests\panels_ipe\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 and publish'));
  $this->test_route = 'node/1';
}