title: how to do php unit testing post data passing from javascript to controller?
body: <p>I am using phalcon framework and i want to write a unit test. </p>
  
  <p>In JS I am using Post Method and In my controller</p>
  
  <pre><code>public function controllerAction {
      $this-&gt;view-&gt;disable();
      $body = $this-&gt;request-&gt;getRawBody();
  
      $data = json_decode($body, true);
      $status = array('success'=&gt;true);
  
      if (!$data) {
          throw new \Exception("Invalid JSON Body");
      }} 
  </code></pre>
  
  <p>I need a test function to pass post data to the controller 
  Thanks</p>