You are here

public function ContainerBuilderTest::testSetParameterException in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetParameterException()
  2. 9 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetParameterException()

@covers ::setParameter

File

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

Class

ContainerBuilderTest
@coversDefaultClass \Drupal\Core\DependencyInjection\ContainerBuilder @group DependencyInjection

Namespace

Drupal\Tests\Core\DependencyInjection

Code

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