You are here

public function ContainerBuilderTest::testSetException in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetException()

@covers ::set @expectedException \InvalidArgumentException @expectedExceptionMessage Service ID names must be lowercase: Bar

File

core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php, line 46
Contains \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest.

Class

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

Namespace

Drupal\Tests\Core\DependencyInjection

Code

public function testSetException() {
  $container = new ContainerBuilder();
  $class = new BarClass();
  $container
    ->set('Bar', $class);
  $this
    ->assertNotEquals('bar', $class->_serviceId);
}