title: Skip authorization while functional testing a Laravel application
body: <p>Is there a built-in way to skip authorization completely while testing the controllers?</p>
  
  <p>Sample controller:</p>
  
  <pre><code>public function changePassword(Request $request, LdapInterface $ldap)
  {
      $this-&gt;authorize('change-password');
  
      $this-&gt;validate($request, [
          'pass' =&gt; 'min:8|confirmed|weakpass|required', 
      ]);
  
      $success = $ldap-&gt;updatePassword($request-&gt;get('pass'));
  
      $message = $success ?
          'Your e-mail password has been successfully changed' :
          'An error occured while trying to change your alumni e-mail password.';
  
      return response()-&gt;json(['message' =&gt; $message]);
  }
  </code></pre>
  
  <p>I want to skip <code>change-password</code> rule, which is defined inside the <code>AuthServiceProvider</code> like:</p>
  
  <pre><code>public function boot(GateContract $gate)
  {
      $gate-&gt;define('change-password', function ($user) {
          // Some complex logic here
      });
  }
  </code></pre>
  
  <p>I don't want to add smt. like <code>if (env('APP_ENV') == 'testing') return;</code> inside the code.</p>