public function ParameterBagTest::testHas

Same name in this branch

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

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php, line 88

Class

ParameterBagTest

Namespace

Symfony\Component\DependencyInjection\Tests\ParameterBag

Code

public function testHas() {
  $bag = new ParameterBag(array(
    'foo' => 'bar',
  ));
  $this
    ->assertTrue($bag
    ->has('foo'), '->has() returns true if a parameter is defined');
  $this
    ->assertTrue($bag
    ->has('Foo'), '->has() converts the key to lowercase');
  $this
    ->assertFalse($bag
    ->has('bar'), '->has() returns false if a parameter is not defined');
}