You are here

protected function WebTestBase::setContainerParameter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::setContainerParameter()

Changes parameters in the services.yml file.

Parameters

$name: The name of the parameter.

$value: The value of the parameter.

8 calls to WebTestBase::setContainerParameter()
TwigDebugMarkupTest::testTwigDebugMarkup in core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php
Tests debug markup added to Twig template output.
TwigSettingsTest::testTwigAutoReloadOverride in core/modules/system/src/Tests/Theme/TwigSettingsTest.php
Ensures Twig template auto reload setting can be overridden.
TwigSettingsTest::testTwigCacheOverride in core/modules/system/src/Tests/Theme/TwigSettingsTest.php
Ensures Twig template cache setting can be overridden.
TwigSettingsTest::testTwigDebugOverride in core/modules/system/src/Tests/Theme/TwigSettingsTest.php
Ensures Twig engine debug setting can be overridden.
TwigSettingsTest::testTwigInlineWithAutoReload in core/modules/system/src/Tests/Theme/TwigSettingsTest.php
Tests twig inline templates with auto_reload.

... See full list

File

core/modules/simpletest/src/WebTestBase.php, line 1082
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function setContainerParameter($name, $value) {
  $filename = $this->siteDirectory . '/services.yml';
  chmod($filename, 0666);
  $services = Yaml::decode(file_get_contents($filename));
  $services['parameters'][$name] = $value;
  file_put_contents($filename, Yaml::encode($services));

  // Ensure that the cache is deleted for the yaml file loader.
  $file_cache = FileCacheFactory::get('container_yaml_loader');
  $file_cache
    ->delete($filename);
}