You are here

public function ConfigSchemaDeprecationTest::testConfigSchemaDeprecation in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php \Drupal\KernelTests\Core\Config\ConfigSchemaDeprecationTest::testConfigSchemaDeprecation()

Tests config schema deprecation.

File

core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php, line 25

Class

ConfigSchemaDeprecationTest
Tests config schema deprecation.

Namespace

Drupal\KernelTests\Core\Config

Code

public function testConfigSchemaDeprecation() {
  $this
    ->expectDeprecation('The \'complex_structure_deprecated\' config schema is deprecated in drupal:9.1.0 and is removed from drupal 10.0.0. Use the \'complex_structure\' config schema instead. See http://drupal.org/node/the-change-notice-nid.');
  $config = $this
    ->config('config_schema_deprecated_test.settings');
  $config
    ->set('complex_structure_deprecated.type', 'fruits')
    ->set('complex_structure_deprecated.products', [
    'apricot',
    'apple',
  ])
    ->save();
  $this
    ->assertSame([
    'type' => 'fruits',
    'products' => [
      'apricot',
      'apple',
    ],
  ], $config
    ->get('complex_structure_deprecated'));
}