Ejemplo n.º 1
0
 function testGetSetAndNotFound()
 {
     Redirect::set_with_key("after_utente_save", "/utenti/index.php");
     $this->assertEqual(Redirect::get_by_key("after_utente_save")->getUrl(), "/utenti/index.php");
     try {
         $this->assertEqual(Redirect::get_by_key("blabla"), "");
         $this->fail("Non viene lanciata nessuna eccezione se il redirects not found non è presente!!!");
     } catch (Exception $ex) {
     }
     Redirect::set_with_key(Redirect::REDIRECT_NOT_FOUND, "/errors/redirect_not_found.php");
     try {
         $this->assertEqual(Redirect::get_by_key("blabla")->getUrl(), "/errors/redirect_not_found.php");
     } catch (Exception $ex) {
         $this->fail("Viene lanciata un'eccezione dopo aver definito il REDIRECT_NOT_FOUND!!!");
     }
     $this->assertTrue(Redirect::get_by_key("blabla") instanceof Redirect);
 }