You are here

public function ContainerTest::test_setParameter_unfrozenContainer in Service Container 7.2

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

Tests that Container::setParameter() in an unfrozen case works properly.

@covers ::setParameter()

File

tests/src/DependencyInjection/ContainerTest.php, line 100
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_unfrozenContainer() {
  $this->containerDefinition['frozen'] = FALSE;
  $this->container = new Container($this->containerDefinition);
  $this->container
    ->setParameter('some_config', 'new_value');
  $this
    ->assertEquals('new_value', $this->container
    ->getParameter('some_config'), 'Container parameters can be set.');
}