public function ParameterBagTest::testHas in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php \Symfony\Component\DependencyInjection\Tests\ParameterBag\ParameterBagTest::testHas()
@covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::has
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ParameterBag/ ParameterBagTest.php, line 123
Class
Namespace
Symfony\Component\DependencyInjection\Tests\ParameterBagCode
public function testHas() {
$bag = new ParameterBag(array(
'foo' => 'bar',
));
$this
->assertTrue($bag
->has('foo'), '->has() returns true if a parameter is defined');
$this
->assertTrue($bag
->has('Foo'), '->has() converts the key to lowercase');
$this
->assertFalse($bag
->has('bar'), '->has() returns false if a parameter is not defined');
}