You are here

public function SessionTest::testGetIterator in Zircon Profile 8.0

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

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

File

vendor/symfony/http-foundation/Tests/Session/SessionTest.php, line 196

Class

SessionTest
SessionTest.

Namespace

Symfony\Component\HttpFoundation\Tests\Session

Code

public function testGetIterator() {
  $attributes = array(
    'hello' => 'world',
    'symfony' => 'rocks',
  );
  foreach ($attributes as $key => $val) {
    $this->session
      ->set($key, $val);
  }
  $i = 0;
  foreach ($this->session as $key => $val) {
    $this
      ->assertEquals($attributes[$key], $val);
    ++$i;
  }
  $this
    ->assertEquals(count($attributes), $i);
}