title: PHPUnit on Laravel setUpBeforeClass can't find factory class
body: <p>I am trying to run a unit test that enters data into a database before the test run. I have defined a setup method which runs for each test case which what I don't want. The setup method executes fine with no issue. What I want is to have the data entered into the db once and then used by all test cases. So I setup a static function setUpBeforeClass.</p>
  
  <pre><code>public static function setUpBeforeClass() : void {
      parent::setUpBeforeClass();
      static::$journalOption = new JournalOption;
      $this-&gt;user = factory(User::class)-&gt;create();
  
  
  }
  </code></pre>
  
  <p>When the user factory class is called I get the following error:</p>
  
  <p>InvalidArgumentException: Unable to locate factory with name [default] [App\User]</p>
  
  <p>The UserFactory.php file exists in database/factories/UserFactory.php</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Support\Str;
  use Faker\Generator as Faker;
  
  
  $factory-&gt;define(App\User::class, function (Faker $faker) {
      return [
          'name' =&gt; $faker-&gt;name,
          'email' =&gt; $faker-&gt;unique()-&gt;safeEmail,
          'email_verified_at' =&gt; now(),
          'password' =&gt; '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
          'remember_token' =&gt; Str::random(10),
      ];
  });
  </code></pre>