You are here

public function ParameterBagTest::testResolveIndicatesWhyAParameterIsNeeded in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/ParameterBag/ParameterBagTest.php \Symfony\Component\DependencyInjection\Tests\ParameterBag\ParameterBagTest::testResolveIndicatesWhyAParameterIsNeeded()

@covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve

File

vendor/symfony/dependency-injection/Tests/ParameterBag/ParameterBagTest.php, line 204

Class

ParameterBagTest

Namespace

Symfony\Component\DependencyInjection\Tests\ParameterBag

Code

public function testResolveIndicatesWhyAParameterIsNeeded() {
  $bag = new ParameterBag(array(
    'foo' => '%bar%',
  ));
  try {
    $bag
      ->resolve();
  } catch (ParameterNotFoundException $e) {
    $this
      ->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e
      ->getMessage());
  }
  $bag = new ParameterBag(array(
    'foo' => '%bar%',
  ));
  try {
    $bag
      ->resolve();
  } catch (ParameterNotFoundException $e) {
    $this
      ->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e
      ->getMessage());
  }
}