You are here

public function ParameterBagTest::testGetIterator in Zircon Profile 8

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

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

File

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

Class

ParameterBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetIterator() {
  $parameters = array(
    'foo' => 'bar',
    'hello' => 'world',
  );
  $bag = new ParameterBag($parameters);
  $i = 0;
  foreach ($bag as $key => $val) {
    ++$i;
    $this
      ->assertEquals($parameters[$key], $val);
  }
  $this
    ->assertEquals(count($parameters), $i);
}