public function ParameterBagTest::testHas

Same name in this branch

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

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php, line 114

Class

ParameterBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

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