function ContainerBuilderTest::testSetException
@covers ::set
File
-
core/
tests/ Drupal/ Tests/ Core/ DependencyInjection/ ContainerBuilderTest.php, line 40
Class
- ContainerBuilderTest
- @coversDefaultClass \Drupal\Core\DependencyInjection\ContainerBuilder @group DependencyInjection
Namespace
Drupal\Tests\Core\DependencyInjectionCode
public function testSetException() {
$container = new ContainerBuilder();
$class = new BarClass();
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Service ID names must be lowercase: Bar');
$container->set('Bar', $class);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.