public function ParameterBagTest::testGetBoolean in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/ParameterBagTest.php \Symfony\Component\HttpFoundation\Tests\ParameterBagTest::testGetBoolean()
@covers Symfony\Component\HttpFoundation\ParameterBag::getBoolean
File
- vendor/
symfony/ http-foundation/ Tests/ ParameterBagTest.php, line 257
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testGetBoolean() {
$parameters = array(
'string_true' => 'true',
'string_false' => 'false',
);
$bag = new ParameterBag($parameters);
$this
->assertTrue($bag
->getBoolean('string_true'), '->getBoolean() gets the string true as boolean true');
$this
->assertFalse($bag
->getBoolean('string_false'), '->getBoolean() gets the string false as boolean false');
$this
->assertFalse($bag
->getBoolean('unknown'), '->getBoolean() returns false if a parameter is not defined');
}