You are here

public function PanelizerLayoutIDUpdateTest::testUpdate in Panelizer 8.5

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

Test updates.

File

tests/src/Functional/Update/PanelizerLayoutIDUpdateTest.php, line 27

Class

PanelizerLayoutIDUpdateTest
Tests the updating of Layout IDs.

Namespace

Drupal\Tests\panelizer\Functional\Update

Code

public function testUpdate() {
  $module_handler = $this->container
    ->get('module_handler');
  $this
    ->assertFalse($module_handler
    ->moduleExists('layout_builder'));
  $this
    ->assertFalse($module_handler
    ->moduleExists('core_context'));
  $this
    ->assertFalse($module_handler
    ->moduleExists('layout_library'));
  $this
    ->runUpdates();
  $module_handler = $this->container
    ->get('module_handler');
  $this
    ->assertTrue($module_handler
    ->moduleExists('layout_builder'));
  $this
    ->assertTrue($module_handler
    ->moduleExists('core_context'));
  $this
    ->assertTrue($module_handler
    ->moduleExists('layout_library'));
  $this
    ->drupalLogin($this->rootUser);

  // Defaults are not editable in Panelizer 5.x.
  $this
    ->drupalGet('admin/structure/types/manage/article/display');
  $this
    ->clickLink('Edit', 1);
  $this
    ->assertResponse(403);
  $this
    ->drupalGet('node/1');
  $this
    ->assertResponse(200);
  $this
    ->drupalGet('node/2');
  $this
    ->assertResponse(200);
}