function ContainerBuilderTest::testSetParameterException

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetParameterException()
  2. 10 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetParameterException()
  3. 9 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetParameterException()
  4. 8.9.x core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetParameterException()

Tests set parameter exception.

File

core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php, line 37

Class

ContainerBuilderTest
Tests Drupal\Core\DependencyInjection\ContainerBuilder.

Namespace

Drupal\Tests\Core\DependencyInjection

Code

public function testSetParameterException() : void {
  $container = new ContainerBuilder();
  $this->expectException(\InvalidArgumentException::class);
  $this->expectExceptionMessage('Parameter names must be lowercase: Buzz');
  $container->setParameter('Buzz', 'buzz');
}

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