You are here

public function ContainerTest::test_setParameter_frozenContainer in Service Container 7

Same name and namespace in other branches
  1. 7.2 tests/src/DependencyInjection/ContainerTest.php \Drupal\Tests\service_container\DependencyInjection\ContainerTest::test_setParameter_frozenContainer()

Tests that Container::setParameter() in a frozen case works properly.

@covers ::setParameter()

@expectedException \Symfony\Component\DependencyInjection\Exception\LogicException

File

tests/src/DependencyInjection/ContainerTest.php, line 114
Contains \Drupal\Tests\service_container\DependencyInjection\ContainerTest

Class

ContainerTest
@coversDefaultClass \Drupal\service_container\DependencyInjection\Container @group dic

Namespace

Drupal\Tests\service_container\DependencyInjection

Code

public function test_setParameter_frozenContainer() {
  $this->containerDefinition['frozen'] = TRUE;
  $this->container = new Container($this->containerDefinition);
  $this->container
    ->setParameter('some_config', 'new_value');
}