title: Laravel - A facade root has not been set
body: <p>I have a problem running tests in my laravel app.
  My app is splitted into separated namespaces. Laravel App namespace is in app directory and it's App/ namespace. I have additional namespace in src directory.</p>
  
  <p>My TestCase look like that:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace Tests\Unit;
  
  use Illuminate\Foundation\Testing\DatabaseTransactions;
  use PHPUnit\Framework\TestCase;
  use SmoothCode\Sample\Domain\User\User;
  use SmoothCode\Sample\Domain\User\UserRepository;
  use SmoothCode\Sample\Domain\User\ValueObject\ConfirmationCode;
  use SmoothCode\Sample\Shared\ValueObjects\Email;
  use SmoothCode\Sample\Shared\ValueObjects\Id;
  use SmoothCode\Sample\Shared\ValueObjects\Password;
  use Tests\CreatesApplication;
  
  
  class UserDomainTest extends TestCase
  {
      use CreatesApplication;
  
      protected UserRepository $userRepository;
  
      public function testUserCreation() {
          $user = User::create(
              Id::generate(),
              'Jan',
              'Kowalski',
              new Email('test@test.com'),
              '123123123',
              new Password('Pass123!'),
              new \DateTimeImmutable(),
              ConfirmationCode::generate()
          );
  //
  //        $this-&gt;assertInstanceOf(User::class, $user);
      }
  
      protected function setUp(): void
      {
          parent::setUp();
      }
  
  
  }
  </code></pre>
  
  <p>After running vendor/bin/phpunit I'm getting following error:</p>
  
  <pre><code>1) Tests\Unit\UserDomainTest::testUserCreation
  RuntimeException: A facade root has not been set.
  
  /home/jakub/Development/Projects/streetboss-server/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258
  /home/jakub/Development/Projects/streetboss-server/src/Sample/Shared/ValueObjects/Password.php:15
  /home/jakub/Development/Projects/streetboss-server/tests/Unit/UserDomainTest.php:29
  </code></pre>
  
  <p>From that i know that the problem lies in src/Sample/Shared/ValueObjects/Password.php:15</p>
  
  <p>which looks like:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace SmoothCode\Sample\Shared\ValueObjects;
  
  use Illuminate\Support\Facades\Hash;
  use Webmozart\Assert\Assert;
  
  class Password {
      protected string $hash;
  
      public function __construct($plainPassword)
      {
          Assert::minLength($plainPassword, 6);
  
          $this-&gt;hash = Hash::make($plainPassword);
      }
  
      public function hashedPassword()
      {
          return $this-&gt;hash;
      }
  
  
  }
  </code></pre>
  
  <pre><code>I was trying to run:
  php artisan config:cache
  php artisan cache:clear
  php artisan config:clear
  composer dump-autoload
  </code></pre>
  
  <p>But I'm still getting this error.</p>