You are here

protected function PanelizerIntegrationTest::setUp in Panelizer 8.5

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

Overrides BrowserTestBase::setUp

File

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

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->container
    ->get('panelizer')
    ->setPanelizerSettings('node', 'page', 'default', [
    'enable' => TRUE,
    'allow' => FALSE,
    'custom' => FALSE,
    'default' => 'default',
  ]);

  // Set the window size to ensure that IPE elements are visible.
  $this
    ->getSession()
    ->resizeWindow(1024, 768);

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