title: Laravel Testing login Credential using phpunit + multiprocess
body: <p>I'm pretty new on unit testing and I want to try to test my login page 
  my Goal for this unit are :
  -> if it match in database -> redirect to route '/'
  -> if not -> redirect to route '/login'</p>
  
  <pre><code>&lt;?php
  
  namespace Tests\Feature;
  
  use App\Domain\Core\Models\User;
  use Illuminate\Support\Facades\Hash;
  use Illuminate\Support\Facades\Session;
  use Tests\TestCase;
  use Illuminate\Foundation\Testing\WithoutMiddleware;
  use Illuminate\Foundation\Testing\DatabaseMigrations;
  use Illuminate\Foundation\Testing\DatabaseTransactions;
  
  class userTest extends TestCase
  {
      use DatabaseMigrations;
      /**
       * A basic test example.
       *
       * @return void
       */
      public function testLoginTrue()
      {
          $credential = [
              'email' =&gt; 'user@ad.com',
              'password' =&gt; 'user'
          ];
           $this-&gt;post('login',$credential)-&gt;assertRedirect('/');
      }
  
      public function testLoginFalse()
      {
          $credential = [
              'email' =&gt; 'user@ad.com',
              'password' =&gt; 'usera'
          ];
          $this-&gt;post('login',$credential)-&gt;assertRedirect('/login');
      }
  }
  </code></pre>
  
  <p>when I test on TestLoginTrue , its successfully return to '/' But when i try the TestLoginFalse ... it return same like TestLoginTrue, it should be stayed on '/login' route,
  Any Idea?</p>
  
  <p>Plus I want to try to check if when I already login I couldn't access the login page so my initial idea is :
  public function testLoginTrue()</p>
  
  <pre><code>{
      $credential = [
          'email' =&gt; 'user@ad.com',
          'password' =&gt; 'user'
      ];
       $this-&gt;post('login',$credential)
           -&gt;assertRedirect('/')
           -&gt;get('/login')
           -&gt;assertRedirect('/');
  }
  </code></pre>
  
  <p>but... it returns</p>
  
  <blockquote>
    <p>1) Tests\Feature\userTest::testLoginTrue BadMethodCallException:
    Method [get] does not exist on Redirect.</p>
  </blockquote>
  
  <p>So how to do it correctly?</p>
  
  <p>Thanks in advance </p>