public function PanelizerAddDefaultLinkTest::test in Panelizer 8.4
Same name and namespace in other branches
- 8.5 tests/src/Functional/PanelizerAddDefaultLinkTest.php \Drupal\Tests\panelizer\Functional\PanelizerAddDefaultLinkTest::test()
Confirm a content type can be panelized and unpanelized.
File
- tests/
src/ Functional/ PanelizerAddDefaultLinkTest.php, line 43
Class
- PanelizerAddDefaultLinkTest
- @group panelizer
Namespace
Drupal\Tests\panelizer\FunctionalCode
public function test() {
// Place the local actions block in the theme so that we can assert the
// presence of local actions and such.
$this
->drupalPlaceBlock('local_actions_block', [
'region' => 'content',
'theme' => \Drupal::theme()
->getActiveTheme()
->getName(),
]);
$content_type = 'page';
// Log in the user.
$this
->loginUser1();
// Create the content type.
$this
->drupalCreateContentType([
'type' => $content_type,
'name' => 'Page',
]);
// Panelize the content type.
$this
->panelize($content_type);
// Confirm that the content type is now panelized.
$this
->assertLink('Add a new Panelizer default display');
// Un-panelize the content type.
$this
->unpanelize($content_type);
// Confirm that the content type is no longer panelized.
$this
->assertNoLink('Add a new Panelizer default display');
}