You are here

public function FlashBagTest::testLegacyGetIterator in Zircon Profile 8.0

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

@covers Symfony\Component\HttpFoundation\Session\Flash\FlashBag::getIterator @group legacy

File

vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php, line 139

Class

FlashBagTest
FlashBagTest.

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Flash

Code

public function testLegacyGetIterator() {
  $flashes = array(
    'hello' => 'world',
    'beep' => 'boop',
    'notice' => 'nope',
  );
  foreach ($flashes as $key => $val) {
    $this->bag
      ->set($key, $val);
  }
  $i = 0;
  foreach ($this->bag as $key => $val) {
    $this
      ->assertEquals(array(
      $flashes[$key],
    ), $val);
    ++$i;
  }
  $this
    ->assertEquals(count($flashes), $i);
  $this
    ->assertCount(0, $this->bag
    ->all());
}