public function testFlashMessage() { $h = new App($this->container); $s = new Session(); $this->assertEmpty($h->flashMessage()); $s->flash('test & test'); $this->assertEquals('<div class="alert alert-success alert-fade-out">test & test</div>', $h->flashMessage()); $this->assertEmpty($h->flashMessage()); $this->assertEmpty($h->flashMessage()); $s->flashError('test & test'); $this->assertEquals('<div class="alert alert-error">test & test</div>', $h->flashMessage()); $this->assertEmpty($h->flashMessage()); }
/** * Redirection when there is no project in the database * * @access protected */ protected function redirectNoProject() { $this->session->flash(t('There is no active project, the first step is to create a new project.')); $this->response->redirect('?controller=project&action=create'); }
function flash($name, $value = null) { return Session::flash($name, $value); }