protected function PanelizerTestTrait::setupContentType in Panelizer 8.4
Same name and namespace in other branches
- 8.5 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'.
7 calls to PanelizerTestTrait::setupContentType()
- PanelizerDefaultsTest::test in tests/
src/ Functional/ PanelizerDefaultsTest.php - PanelizerIpeTest::testAdministerEntityContentPermission in tests/
src/ Functional/ PanelizerIpeTest.php - @todo Confirm the 'administer panelizer $entity_type_id $bundle content' permission works.
- PanelizerIpeTest::testAdministerEntityLayoutPermission in tests/
src/ Functional/ PanelizerIpeTest.php - @todo Confirm the 'administer panelizer $entity_type_id $bundle layout' permission works.
- PanelizerIpeTest::testAdministerEntityRevertPermission in tests/
src/ Functional/ PanelizerIpeTest.php - @todo Confirm the 'administer panelizer $entity_type_id $bundle revert' permission works.
- PanelizerIpeTest::testAdministerPanelizerPermission in tests/
src/ Functional/ PanelizerIpeTest.php - Confirm the 'administer panelizer' permission works.
File
- tests/
src/ Functional/ PanelizerTestTrait.php, line 34
Class
- PanelizerTestTrait
- Contains helper methods for writing functional tests of Panelizer.
Namespace
Drupal\Tests\panelizer\FunctionalCode
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();
}