Ejemplo n.º 1
0
 public function CreateAction()
 {
     $uri = $this->getRequest()->getPost('uri');
     $timeout = $this->getRequest()->getPost('timeout');
     $response_body = $this->getRequest()->getPost('response_body');
     $response_status_code = $this->getRequest()->getPost('response_status_code');
     $request_query_key = $this->getRequest()->getPost('request_query_key');
     $request_query_value = $this->getRequest()->getPost('request_query_value');
     $request_post_key = $this->getRequest()->getPost('request_post_key');
     $request_post_value = $this->getRequest()->getPost('request_post_value');
     $response_header_key = $this->getRequest()->getPost('response_header_key');
     $response_header_value = $this->getRequest()->getPost('response_header_value');
     $Mock = new \Service\Mock();
     $Mock->setUri($uri);
     $Mock->setRequestQueryByKeyAndValue($request_query_key, $request_query_value);
     $Mock->setRequestPostByKeyAndValue($request_post_key, $request_post_value);
     $Mock->setResponseHeaderByKeyAndValue($response_header_key, $response_header_value);
     $Mock->setResponseBody($response_body);
     $Mock->setResponseStatusCode($response_status_code);
     $Mock->setTimeout($timeout);
     $Mock->setUser(\Service\Account::getUser());
     $Mock->create();
     $ServiceGenerator = new \Service\Mock\Generator($Mock->getUriId());
     $ServiceGenerator->generate();
     $this->getView()->displayAjax("Create Successfully.", ["uri_id" => $Mock->getUriId()]);
 }
Ejemplo n.º 2
0
 public function isOwner()
 {
     if (!APPLICATION_PHPCAS_OPEN) {
         return true;
     }
     return $this->_user == Account::getUser();
 }
Ejemplo n.º 3
0
 public function init()
 {
     parent::init();
     $this->getView()->assign('service_status', (new \Service\Mock\Console())->status());
     $this->getView()->assign('account_user', \Service\Account::getUser());
 }