Beispiel #1
0
 public function testFlashMessage()
 {
     $h = new AppHelper($this->container);
     $f = new FlashMessage($this->container);
     $this->assertEmpty($h->flashMessage());
     $f->success('test & test');
     $this->assertEquals('<div class="alert alert-success alert-fade-out">test &amp; test</div>', $h->flashMessage());
     $this->assertEmpty($h->flashMessage());
     $f->failure('test & test');
     $this->assertEquals('<div class="alert alert-error">test &amp; test</div>', $h->flashMessage());
     $this->assertEmpty($h->flashMessage());
 }
Beispiel #2
0
 public function testMessage()
 {
     $flash = new FlashMessage($this->container);
     $flash->success('my message');
     $this->assertEquals('my message', $flash->getMessage('success'));
     $this->assertEmpty($flash->getMessage('success'));
     $flash->failure('my error message');
     $this->assertEquals('my error message', $flash->getMessage('failure'));
     $this->assertEmpty($flash->getMessage('failure'));
     $this->assertEmpty($flash->getMessage('not found'));
 }