You are here

public function HeaderBagTest::testContains in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/HeaderBagTest.php \Symfony\Component\HttpFoundation\Tests\HeaderBagTest::testContains()

@covers Symfony\Component\HttpFoundation\HeaderBag::contains

File

vendor/symfony/http-foundation/Tests/HeaderBagTest.php, line 125

Class

HeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testContains() {
  $bag = new HeaderBag(array(
    'foo' => 'bar',
    'fuzz' => 'bizz',
  ));
  $this
    ->assertTrue($bag
    ->contains('foo', 'bar'), '->contains first value');
  $this
    ->assertTrue($bag
    ->contains('fuzz', 'bizz'), '->contains second value');
  $this
    ->assertFalse($bag
    ->contains('nope', 'nope'), '->contains unknown value');
  $this
    ->assertFalse($bag
    ->contains('foo', 'nope'), '->contains unknown value');

  // Multiple values
  $bag
    ->set('foo', 'bor', false);
  $this
    ->assertTrue($bag
    ->contains('foo', 'bar'), '->contains first value');
  $this
    ->assertTrue($bag
    ->contains('foo', 'bor'), '->contains second value');
  $this
    ->assertFalse($bag
    ->contains('foo', 'nope'), '->contains unknown value');
}