public function HeaderBagTest::testReplace

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

File

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

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