Пример #1
0
 /**
  *
  * Test
  *
  * @return void
  *
  */
 public function testMessages()
 {
     $flash = new \rudden\Flash\FlashMessages();
     $di = new \Anax\DI\CDIFactoryDefault();
     $flash->setDI($di);
     $di->setShared('session', function () {
         $session = new \Anax\Session\CSession();
         $session->configure(ANAX_APP_PATH . 'config/session.php');
         $session->name();
         return $session;
     });
     $str = "test";
     $msg1 = $flash->message('info', $str);
     $msg2 = $flash->info('test');
     $this->assertEquals($msg1, $msg2, "Values doesn't match.");
     $msg1 = $flash->message('error', $str);
     $msg2 = $flash->error('test');
     $this->assertEquals($msg1, $msg2, "Values doesn't match.");
     $msg1 = $flash->message('success', $str);
     $msg2 = $flash->success('test');
     $this->assertEquals($msg1, $msg2, "Values doesn't match.");
     $msg1 = $flash->message('warning', $str);
     $msg2 = $flash->warning('test');
     $this->assertEquals($msg1, $msg2, "Values doesn't match.");
 }