class ConfigSchemaDeprecationTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php \Drupal\KernelTests\Core\Config\ConfigSchemaDeprecationTest
- 10 core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php \Drupal\KernelTests\Core\Config\ConfigSchemaDeprecationTest
Tests config schema deprecation.
@group config @group legacy
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Config\ConfigSchemaDeprecationTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of ConfigSchemaDeprecationTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Config/ ConfigSchemaDeprecationTest.php, line 13
Namespace
Drupal\KernelTests\Core\ConfigView source
class ConfigSchemaDeprecationTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'config_schema_deprecated_test',
];
/**
* Tests config schema deprecation.
*/
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'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.