public function testInstantiation() { $exception = new Unauthorized(9, [1, 2, 3]); $this->assertEquals('Unauthorized', $exception->getMessage()); $this->assertEquals(401, $exception->getStatusCode()); $this->assertEquals(9, $exception->getCode()); $this->assertEquals([1, 2, 3], $exception->getDetails()); }
{ var $tpl; var $formArray; var $sess; function Unauthorized($sess) { $this->sess = $sess; $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "Unauthorized.htm"); $this->tpl->set_var("TITLE", "Unauthorized"); } function Main() { $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); } } ##################################### # Define Procedures and Functions ##################################### ########################################################## # Begin Program Script ########################################################## //* page_open(array("sess" => "rpts_Session")); //*/ $unauthorized = new Unauthorized($sess); $unauthorized->Main(); page_close();