Beispiel #1
0
 public function testKeepFlashForNextRequest()
 {
     $_SESSION['slim.flash'] = array('info' => 'Foo');
     $s = new Slim();
     $s->get('/bar', function () use($s) {
         $s->flashKeep();
     });
     $s->run();
     $this->assertEquals('Foo', $_SESSION['slim.flash']['info']);
 }
Beispiel #2
0
 /**
  * Slim Keep Flash
  *
  * Pre-conditions:
  * Slim app receives existing Flash message from $_SESSION;
  *
  * Post-conditions:
  * Message is re-persisted to $_SESSION after app is run;
  */
 public function testSlimFlashKeep()
 {
     $_SESSION['flash'] = array('info' => 'Foo');
     $app = new Slim();
     $app->get('/', function () use($app) {
         $app->flashKeep();
     });
     $app->run();
     $this->assertArrayHasKey('info', $_SESSION['flash']);
     $this->assertEquals('Foo', $_SESSION['flash']['info']);
 }