title: PHP Unit testing setting JWT token after login test completes
body: <p>Hi I'm trying to set JWT token after the login test is complete in a global var and then extend all tests off of that class, now I'm not sure if I am even doing it right so any help is appreciated or documentation I could look up</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?php
  use Illuminate\Support\Facades\Config;
  
  class AuthenticationTest extends TestCase {
      /**
       * @var string
       */
      public $token = '';
  
      /**
       * Register test user
       *
       * @return void
       */
      public function testRegister()
      {
          $this-&gt;json('post', '/auth/register', [
              'email' =&gt; Config::get('tests.email'),
              'password' =&gt; Config::get('tests.password'),
              'companyName' =&gt; Config::get('tests.companyName'),
              'firstname' =&gt; Config::get('tests.firstname'),
              'lastname' =&gt; Config::get('tests.lastname')
          ]);
          $this-&gt;assertEquals(200, $this-&gt;response-&gt;status());
          $this-&gt;seeJsonEquals([
              'message' =&gt; "Registration successful, please confirm email to login",
              'status'  =&gt; true,
          ]);
      }
      /**
       * Login test user
       *
       * @return void
       */
      public function testLogin()
      {
          $email = Config::get('tests.email');
          $password = Config::get('tests.password');
          $encryptedToken = base64_encode($email . ":" . $password);
          $this-&gt;json('post', 'auth/login', ['token' =&gt; $encryptedToken]);
          $this-&gt;assertEquals(200, $this-&gt;response-&gt;status());
          $this-&gt;seeJsonStructure([
              'token',
              'refresh',
              'status'
          ]);
          $content = json_decode($this-&gt;response-&gt;getContent());
          $this-&gt;assertObjectHasAttribute('token', $content);
          $this-&gt;token = $content-&gt;token;
          $this-&gt;token;
  
      }
  }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>The login test works as it should but the token isn't being set for other tests that extend off of this test case ad use $this-&gt;token to send the JWT token</p>