public function testSetFlashForCurrentRequest() { $s = new Slim(); $s->get('/bar', function () use($s) { $s->flashNow('info', 'bar'); }); $s->run(); $env = $s->environment(); $this->assertEquals('bar', $env['slim.flash']['info']); }
/** * Slim Flash Now * * Pre-conditions: * Slim app sets Flash message for current request; * * Post-conditions: * Message is persisted to View data; */ public function testSlimFlashNow() { $app = new Slim(); $app->get('/', function () use($app) { $app->flashNow('info', 'Foo'); }); $app->run(); $flash = $app->view()->getData('flash'); $this->assertEquals('Foo', $flash['info']); }