public function SessionTest::testGetIterator

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

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php, line 196

Class

SessionTest
SessionTest

Namespace

Symfony\Component\HttpFoundation\Tests\Session

Code

public function testGetIterator() {
  $attributes = array(
    'hello' => 'world',
    'symfony2' => '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);
}