public function ContainerTest::testGetThrowsException

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php, line 417

Class

ContainerTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testGetThrowsException() {
  $c = new ProjectServiceContainer();
  try {
    $c
      ->get('throw_exception');
    $this
      ->fail();
  } catch (\Exception $e) {
    $this
      ->assertEquals('Something went terribly wrong!', $e
      ->getMessage());
  }
  try {
    $c
      ->get('throw_exception');
    $this
      ->fail();
  } catch (\Exception $e) {
    $this
      ->assertEquals('Something went terribly wrong!', $e
      ->getMessage());
  }
}