Laravel PHPUnit always passes CSRF
<p>I'm currently writing a test to assure that our CSRF protection works in Laravel. The test looks like this.</p>

<pre><code>public function testSecurityIncorrectCSRF()
{
    $this-&gt;visit('/login')
     -&gt;type('REDACTED', 'email')
     -&gt;type('123123', 'password');

     session()-&gt;regenerateToken();

     $this-&gt;press('login')
     -&gt;seePageIs('/login');
}
</code></pre>

<p>No matter what I do, and even if I pass a wrong _token, the login request will always succeed. I've tried outside of the PHPUnit test and there the CSRF protection works. All my middlewares are enabled, so the CSRF protection should be enabled.</p>

<p>Can anybody explain why this happens?</p>