private function check_request_method($value)
 {
     switch (strtolower($value)) {
         case 'ajax':
             return Request::is_ajax();
         case 'post':
             return Request::is_post();
         case 'get':
             return Request::is_get();
         default:
             return false;
     }
 }
Example #2
0
 /**
  * @covers common\classes\Request::is_ajax
  */
 public function test_is_ajax()
 {
     $_SERVER['HTTP_X_REQUESTED_WITH'] = 'xmlhttprequest';
     self::assertTrue(Request::is_ajax());
 }