function ConfigEntityImportTest::doSearchPageUpdate

Same name in other branches
  1. 9 core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php \Drupal\Tests\system\Kernel\Entity\ConfigEntityImportTest::doSearchPageUpdate()
  2. 8.9.x core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php \Drupal\Tests\system\Kernel\Entity\ConfigEntityImportTest::doSearchPageUpdate()
  3. 10 core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php \Drupal\Tests\system\Kernel\Entity\ConfigEntityImportTest::doSearchPageUpdate()

Tests updating a search page during import.

1 call to ConfigEntityImportTest::doSearchPageUpdate()
ConfigEntityImportTest::testConfigUpdateImport in core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
Runs test methods for each module within a single test run.

File

core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php, line 170

Class

ConfigEntityImportTest
Tests ConfigEntity importing.

Namespace

Drupal\Tests\system\Kernel\Entity

Code

protected function doSearchPageUpdate() : void {
    // Create a test search page with a known label.
    $name = 'search.page.apple';
    $entity = SearchPage::create([
        'id' => 'apple',
        'label' => 'Apple search',
        'path' => 'apple',
        'plugin' => 'search_extra_type_search',
    ]);
    $entity->save();
    $this->checkSinglePluginConfigSync($entity, 'configuration', 'boost', 'bi');
    // Read the existing data, and prepare an altered version in sync.
    $custom_data = $original_data = $this->container
        ->get('config.storage')
        ->read($name);
    $custom_data['configuration']['boost'] = 'asdf';
    $this->assertConfigUpdateImport($name, $original_data, $custom_data);
}

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