public function testIsValidWhenTakeALotOfArguments() { //all types that should be pass $this->assertTrue(ResponseType::isValid(ResponseType::CSV)); $this->assertTrue(ResponseType::isValid(ResponseType::HTML)); $this->assertTrue(ResponseType::isValid(ResponseType::JSON)); $this->assertTrue(ResponseType::isValid(ResponseType::XML)); $this->assertTrue(ResponseType::isValid(ResponseType::XLS)); $this->assertTrue(ResponseType::isValid(ResponseType::EMPT)); }
/** * Método interno utilizado para realizar o procesamento da ação solicitada * @param type $action */ private final function _processRequest($action) { $this->method = $action; //Define o nome do método que deverá ser chamado $method = '_' . $action; if (!method_exists($this, $method)) { if (method_exists($this, $this->defaultMethod)) { $method = $this->defaultMethod; } else { $method = ''; } } if (empty($method)) { $errorPage = Factory::page('ErrorPage'); $errorPage->setErrorMessage('O Método solicitado: "' . $action . '" não foi implementado'); return $errorPage; } else { $this->preProcess(); if ($this->canAccess()) { $this->executeMethod($method); } else { //permissão negada $deniedaccess = Factory::page("DeniedacessPage"); $deniedaccess->service(ProcessRequest::getMethod(), "_index", ResponseType::getDefaultType()); exit; } $this->posProcess(); } }