protected function PanelizerTestTrait::unpanelize in Panelizer 8.4
Same name and namespace in other branches
- 8.5 tests/src/Functional/PanelizerTestTrait.php \Drupal\Tests\panelizer\Functional\PanelizerTestTrait::unpanelize()
Unpanelizes a node type's default view display.
Panelizer is disabled for the display, but its configuration is retained.
Parameters
string $content_type: The content type, i.e. the node bundle ID, to configure; defaults to 'page'.
string $display: (optional) The view mode to work on.
array $values: (optional) Additional form values.
3 calls to PanelizerTestTrait::unpanelize()
- PanelizerAddDefaultLinkTest::test in tests/
src/ Functional/ PanelizerAddDefaultLinkTest.php - Confirm a content type can be panelized and unpanelized.
- PanelizerNodeFunctionalTest::testWizardUI in tests/
src/ Functional/ PanelizerNodeFunctionalTest.php - Tests the admin interface to set a default layout for a bundle.
- PanelizerNodeTranslationsTest::_testWizardUI in tests/
src/ Functional/ PanelizerNodeTranslationsTest.php - Tests the admin interface to set a default layout for a bundle.
File
- tests/
src/ Functional/ PanelizerTestTrait.php, line 116
Class
- PanelizerTestTrait
- Contains helper methods for writing functional tests of Panelizer.
Namespace
Drupal\Tests\panelizer\FunctionalCode
protected function unpanelize($content_type = 'page', $display = NULL, array $values = []) {
$this
->drupalGet("admin/structure/types/manage/{$content_type}/display/{$display}");
$this
->assertResponse(200);
$edit = [
'panelizer[enable]' => FALSE,
] + $values;
$this
->drupalPostForm(NULL, $edit, t('Save'));
$this
->assertResponse(200);
\Drupal::service('entity_display.repository')
->getFormDisplay('node', $content_type, 'default')
->removeComponent('panelizer')
->save();
}