function TempstoreKeyUpdatePathTest::testRunUpdates

Tests the upgrade path for Layout Builder extra fields.

File

core/modules/layout_builder/tests/src/Functional/Update/TempstoreKeyUpdatePathTest.php, line 31

Class

TempstoreKeyUpdatePathTest
Tests the upgrade path for Layout Builder tempstore keys.

Namespace

Drupal\Tests\layout_builder\Functional\Update

Code

public function testRunUpdates() {
    $page = $this->getSession()
        ->getPage();
    $assert_session = $this->assertSession();
    $this->runUpdates();
    $this->drupalLogin($this->drupalCreateUser([
        'configure any layout',
        'administer node display',
    ]));
    $this->drupalGet('node/1');
    $assert_session->elementExists('css', '.layout--onecol');
    $assert_session->elementNotExists('css', '.layout--twocol-section');
    $page->clickLink('Layout');
    $assert_session->pageTextContains('You have unsaved changes.');
    $assert_session->elementNotExists('css', '.layout--onecol');
    $assert_session->elementExists('css', '.layout--twocol-section');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.