function SchemaListenerController::test

Same name and namespace in other branches
  1. 11.x core/modules/config/tests/config_test/src/SchemaListenerController.php \Drupal\config_test\SchemaListenerController::test()
  2. 9 core/modules/config/tests/config_test/src/SchemaListenerController.php \Drupal\config_test\SchemaListenerController::test()
  3. 8.9.x core/modules/config/tests/config_test/src/SchemaListenerController.php \Drupal\config_test\SchemaListenerController::test()
  4. main core/modules/config/tests/config_test/src/SchemaListenerController.php \Drupal\config_test\SchemaListenerController::test()

Tests the BrowserTestBase tests can use strict schema checking.

1 string reference to 'SchemaListenerController::test'
config_test.routing.yml in core/modules/config/tests/config_test/config_test.routing.yml
core/modules/config/tests/config_test/config_test.routing.yml

File

core/modules/config/tests/config_test/src/SchemaListenerController.php, line 37

Class

SchemaListenerController
Controller for testing \Drupal\Core\Config\Development\ConfigSchemaChecker.

Namespace

Drupal\config_test

Code

public function test() {
  try {
    $this->configFactory
      ->getEditable('config_schema_test.schemaless')
      ->set('foo', 'bar')
      ->save();
  } catch (SchemaIncompleteException $e) {
    return [
      '#markup' => $e->getMessage(),
    ];
  }
}

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