You are here

public function ParameterBagTest::testGetInt in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/ParameterBagTest.php \Symfony\Component\HttpFoundation\Tests\ParameterBagTest::testGetInt()

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

File

vendor/symfony/http-foundation/Tests/ParameterBagTest.php, line 180

Class

ParameterBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetInt() {
  $bag = new ParameterBag(array(
    'digits' => '0123',
  ));
  $this
    ->assertEquals(123, $bag
    ->getInt('digits'), '->getInt() gets a value of parameter as integer');
  $this
    ->assertEquals(0, $bag
    ->getInt('unknown'), '->getInt() returns zero if a parameter is not defined');
}