You are here

public function ParameterBagTest::testRemove in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php \Symfony\Component\DependencyInjection\Tests\ParameterBag\ParameterBagTest::testRemove()

@covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::remove

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php, line 49

Class

ParameterBagTest

Namespace

Symfony\Component\DependencyInjection\Tests\ParameterBag

Code

public function testRemove() {
  $bag = new ParameterBag(array(
    'foo' => 'foo',
    'bar' => 'bar',
  ));
  $bag
    ->remove('foo');
  $this
    ->assertEquals(array(
    'bar' => 'bar',
  ), $bag
    ->all(), '->remove() removes a parameter');
  $bag
    ->remove('BAR');
  $this
    ->assertEquals(array(), $bag
    ->all(), '->remove() converts key to lowercase before removing');
}