title: Phpunit : hadling the validation exception in laravel
body: <p>I have turned <code>throw Exception</code> in <code>handler.php</code> so that I can catch <code>exceptions</code> and see the <code>errors</code> but what happened is when I try to do the <code>validation checks</code> it throws me an exception which is correct but in my test case instead of catching the <code>exception</code> i'm asserting that the session has errors.</p>
  
  <pre><code>/** @test*/
      public function a_thread_requires_a_title(){
  
          $thread = make('App\Thread', ['title'=&gt; null]);
          $this-&gt;post('threads', $thread-&gt;toArray())
              -&gt;assertSessionHasErrors('title');
      }
  </code></pre>
  
  <p>Since, <code>validation error</code> is an exception so it throws me an exception because I've modified the <code>handler.php</code> file as </p>
  
  <pre><code>if(app()-&gt;environment() === "testing") throw $exception;
  </code></pre>
  
  <p>so, what I'm trying to do is change the env for this one test so that it wont throw me an 'Exception'</p>