function InputTest::testDefaultValueFromNonExistentConfig

File

core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php, line 149

Class

InputTest
@group Recipe @covers \Drupal\Core\Recipe\InputConfigurator

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testDefaultValueFromNonExistentConfig() : void {
    $recipe = $this->createRecipe(<<<YAML
name: 'Default value from non-existent config'
input:
  capital:
    data_type: string
    description: This will be erroneous.
    default:
      source: config
      config: ['foo.baz', 'bar']
YAML
);
    $this->expectException(\RuntimeException::class);
    $this->expectExceptionMessage("The 'foo.baz' config object does not exist.");
    $recipe->input
        ->collectAll($this->createMock(InputCollectorInterface::class));
}

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