You are here

protected function PanelizerTestTrait::setupContentType in Panelizer 8.5

Same name and namespace in other branches
  1. 8.4 tests/src/Functional/PanelizerTestTrait.php \Drupal\Tests\panelizer\Functional\PanelizerTestTrait::setupContentType()

Prep a content type for use with these tests.

Parameters

string $content_type: The content type, i.e. the node bundle ID, to configure; defaults to 'page'.

File

tests/src/Functional/PanelizerTestTrait.php, line 34

Class

PanelizerTestTrait
Contains helper methods for writing functional tests of Panelizer.

Namespace

Drupal\Tests\panelizer\Functional

Code

protected function setupContentType($content_type = 'page') {

  // Log in as user 1.
  $this
    ->loginUser1();

  // Create the content type.
  $this
    ->drupalCreateContentType([
    'type' => $content_type,
    'name' => 'Page',
  ]);

  // Allow each node to have a customized display.
  $this
    ->panelize($content_type, NULL, [
    'panelizer[custom]' => TRUE,
  ]);

  // Logout so that a new user can log in.
  $this
    ->drupalLogout();
}