title: Laravel Unit Test - POST Request Payload
body: <p>I need help in creating a unit test case for Laravel. It's an API end point accepting a json as the POST payload (NOT POST form) and basically just creating an entry in the database based on that json object. The API works fine but I'm having trouble in creating the unit test.</p>
  
  <p>The controller code contains</p>
  
  <pre><code>$request = Request::instance();
  $content = $request-&gt;getContent();
  $inputRequest = json_decode($content);
  </code></pre>
  
  <p>I don't know how to pass the payload into the unit test code (extending <code>Illuminate\Foundation\Testing\TestCase</code>)</p>
  
  <p>Anyone able to help?</p>
  
  <p>Thanks heaps</p>