title: use expectException() on laravel custom exception
body: <p>Here is a custom exception</p>
  <pre class="lang-php prettyprint-override"><code>namespace App\Exceptions;
  
  use Exception;
  
  class CustomException extends Exception
  {
      public function render($request)
      {
          return response()-&gt;view('custom-exception');
      }
  }
  </code></pre>
  <p>I throw it inside a Request class</p>
  <pre class="lang-php prettyprint-override"><code>class LoginRequest extends FormRequest
  {
      public function authenticate()
      {
          if (! Auth::attempt($this-&gt;only('email', 'password'))) {
              throw CustomException(); //
          }
      }
  }
  </code></pre>
  <p>This is the controller which call the LoginRequest class</p>
  <pre class="lang-php prettyprint-override"><code>class AuthenticatedSessionController extends Controller
  {
      public function store(LoginRequest $request) //
      {
          $request-&gt;authenticateMember();
  
          $request-&gt;session()-&gt;regenerate();
  
          return redirect()-&gt;intended(RouteServiceProvider::Home);
      }
  }
  </code></pre>
  <p>This is the test</p>
  <pre class="lang-php prettyprint-override"><code>use Tests\TestCase;
  use App\Models\User;
  use App\Exceptions\CustomException;
  
  class EmailVerificationTest extends TestCase
  {
      public function test_email_verification_screen_can_be_rendered()
      {
          $user = User::factory()-&gt;create([
              'email_verified_at' =&gt; null,
          ]);
  
          // $this-&gt;expectException(CustomException::class); //this cannot pass
  
          $response = $this-&gt;post(
              '/login',
              [
                  'email' =&gt; 'john@example.com',
                  'password' =&gt; 'secret'
              ]
          );
  
          $response-&gt;assertViewIs('custom-exception');
  
          $this-&gt;assertInstanceOf(CustomException::class, $response-&gt;exception);
      }
  }    
  </code></pre>
  <hr />
  <p>These assertions can pass:</p>
  <pre class="lang-php prettyprint-override"><code>$response-&gt;assertViewIs('custom-exception');
  
  $this-&gt;assertInstanceOf(CustomException::class, $response-&gt;exception);
  </code></pre>
  <p>But this one cannot pass:</p>
  <pre class="lang-php prettyprint-override"><code>$this-&gt;expectException(CustomException::class);
  </code></pre>
  <blockquote>
  <p>Failed asserting that exception of type &quot;App\Exceptions\CustomException&quot; is thrown.</p>
  </blockquote>
  <p>Why? Any idea?</p>