public function ParameterBagTest::testGetDigits

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

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php, line 147

Class

ParameterBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetDigits() {
  $bag = new ParameterBag(array(
    'word' => 'foo_BAR_012',
  ));
  $this
    ->assertEquals('012', $bag
    ->getDigits('word'), '->getDigits() gets only digits as string');
  $this
    ->assertEquals('', $bag
    ->getDigits('unknown'), '->getDigits() returns empty string if a parameter is not defined');
}