function RecipeTest::testPreExistingDifferentConfiguration

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Recipe/RecipeTest.php \Drupal\KernelTests\Core\Recipe\RecipeTest::testPreExistingDifferentConfiguration()

File

core/tests/Drupal/KernelTests/Core/Recipe/RecipeTest.php, line 48

Class

RecipeTest
@coversDefaultClass \Drupal\Core\Recipe\Recipe[[api-linebreak]] @group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testPreExistingDifferentConfiguration() : void {
  // Install the node module, its dependencies and configuration.
  $this->container
    ->get('module_installer')
    ->install([
    'node',
  ]);
  $this->assertFalse($this->config('node.settings')
    ->get('use_admin_theme'), 'The node.settings:use_admin_theme is set to FALSE');
  try {
    Recipe::createFromDirectory('core/tests/fixtures/recipes/install_node_with_config');
    $this->fail('Expected exception not thrown');
  } catch (RecipePreExistingConfigException $e) {
    $this->assertSame("The configuration 'node.settings' exists already and does not match the recipe's configuration", $e->getMessage());
    $this->assertSame('node.settings', $e->configName);
  }
}

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