You are here

public function ParameterBagTest::testHas in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/symfony/http-foundation/Tests/ParameterBagTest.php \Symfony\Component\HttpFoundation\Tests\ParameterBagTest::testHas()
  2. 8.0 vendor/symfony/dependency-injection/Tests/ParameterBag/ParameterBagTest.php \Symfony\Component\DependencyInjection\Tests\ParameterBag\ParameterBagTest::testHas()
Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/ParameterBagTest.php \Symfony\Component\HttpFoundation\Tests\ParameterBagTest::testHas()

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

File

vendor/symfony/http-foundation/Tests/ParameterBagTest.php, line 136

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');
}