function MakeLayoutUntranslatableUpdatePathTestBase::testDisableTranslationOnLayouts

Tests the upgrade path for translatable layouts.

See also

layout_builder_post_update_make_layout_untranslatable()

File

core/modules/layout_builder/tests/src/Functional/Update/Translatability/MakeLayoutUntranslatableUpdatePathTestBase.php, line 68

Class

MakeLayoutUntranslatableUpdatePathTestBase
Base class for upgrade path for translatable layouts.

Namespace

Drupal\Tests\layout_builder\Functional\Update\Translatability

Code

public function testDisableTranslationOnLayouts() {
    $this->runUpdates();
    foreach ($this->expectedBundleUpdates as $bundle => $field_update_expected) {
        $this->assertEquals($field_update_expected, !FieldConfig::loadByName('node', $bundle, OverridesSectionStorage::FIELD_NAME)->isTranslatable(), $field_update_expected ? "Field on {$bundle} set to be non-translatable." : "Field on {$bundle} not set to non-translatable.");
    }
    $this->assertEquals($this->expectedFieldStorageUpdate, !FieldStorageConfig::loadByName('node', OverridesSectionStorage::FIELD_NAME)->isTranslatable());
}

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