You are here

public function HeaderBagTest::testReplace 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::testReplace()

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

File

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

Class

HeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testReplace() {
  $bag = new HeaderBag(array(
    'foo' => 'bar',
  ));
  $bag
    ->replace(array(
    'NOPE' => 'BAR',
  ));
  $this
    ->assertEquals(array(
    'nope' => array(
      'BAR',
    ),
  ), $bag
    ->all(), '->replace() replaces the input with the argument');
  $this
    ->assertFalse($bag
    ->has('foo'), '->replace() overrides previously set the input');
}