3 namespace Drupal\config_test;
5 use Drupal\Core\Config\ConfigFactoryInterface;
6 use Drupal\Core\Config\Schema\SchemaIncompleteException;
7 use Drupal\Core\Controller\ControllerBase;
8 use Symfony\Component\DependencyInjection\ContainerInterface;
11 * Controller for testing \Drupal\Core\Config\Development\ConfigSchemaChecker.
13 class SchemaListenerController extends ControllerBase {
16 * Constructs the SchemaListenerController object.
18 * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
21 public function __construct(ConfigFactoryInterface $config_factory) {
22 $this->configFactory = $config_factory;
28 public static function create(ContainerInterface $container) {
30 $container->get('config.factory')
35 * Tests the WebTestBase tests can use strict schema checking.
37 public function test() {
39 $this->configFactory->getEditable('config_schema_test.schemaless')->set('foo', 'bar')->save();
41 catch (SchemaIncompleteException $e) {
43 '#markup' => $e->getMessage(),