public function ParameterBagTest::testGet in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/http-foundation/Tests/ParameterBagTest.php \Symfony\Component\HttpFoundation\Tests\ParameterBagTest::testGet()
@covers Symfony\Component\HttpFoundation\ParameterBag::get
File
- vendor/
symfony/ http-foundation/ Tests/ ParameterBagTest.php, line 72
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testGet() {
$bag = new ParameterBag(array(
'foo' => 'bar',
'null' => null,
));
$this
->assertEquals('bar', $bag
->get('foo'), '->get() gets the value of a parameter');
$this
->assertEquals('default', $bag
->get('unknown', 'default'), '->get() returns second argument as default if a parameter is not defined');
$this
->assertNull($bag
->get('null', 'default'), '->get() returns null if null is set');
}