You are here

public function HeaderBagTest::testGetIterator in Zircon Profile 8

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

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

File

vendor/symfony/http-foundation/Tests/HeaderBagTest.php, line 192

Class

HeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

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