Пример #1
0
 public function testAll()
 {
     $this->bag->set('notice', 'Foo');
     $this->bag->set('error', 'Bar');
     $this->assertEquals(array('notice' => array('Foo'), 'error' => array('Bar')), $this->bag->all());
     $this->assertEquals(array(), $this->bag->all());
 }
Пример #2
0
 /**
  * @covers Symfony\Component\HttpFoundation\Session\Flash\FlashBag::getIterator
  * @group legacy
  */
 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());
 }
 /**
  * @covers Symfony\Component\HttpFoundation\Session\Flash\FlashBag::getIterator
  */
 public function testLegacyGetIterator()
 {
     $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
     $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());
 }
Пример #4
0
 public function getNotices()
 {
     return $this->bag->all();
 }