public function ParameterBagTest::testReplace

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

File

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

Class

ParameterBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

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