title: Testing Exceptions in PHPUnit
body: <p>I am new to unit testing and now trying to write some test cases using PHPUnit for a Laravel application. I have done one basic test which is like the following :</p>
  
  <pre><code>public function testGetPointsByApp()
  {
      $this
          -&gt;json(
              'GET',
              self::URL.'/'.$value
          )
          -&gt;assertResponseStatus(200)
          -&gt;seeJson([
              'status' =&gt; 'success',
          ])
          -&gt;seeJsonStructure([
              'status',
              'message',
              'data' =&gt; []
          ]);
  }
  </code></pre>
  
  <p>Now this is working. But I would like to know how can I test for invalid inputs and for the cases like there is not data at all with the given parameters.  I am throwing corresponding exceptions in each of these cases and it will add particular messages. How can I test whether it is thrown ?</p>
  
  <p>I don't want to include it to this method and would like to write some other methods to test different scenarios in the API like invalid UUID, no data etc. So for each time, I need to call the API url or this call can be done from any kind of set up function ?</p>