ReflectionException: Class request does not exist running unit test
I'm getting a Class request does not exist ReflectionException running phpunit. I've run composer dump and php artisan clear:compiled. Laravel 5.7.
<?php declare(strict_types=1);
namespace Tests\Unit;
use DemoSite\Data\Authors\Author;
use DemoSite\Data\Authors\AuthorRepository;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
/**
* @group unit
*/
class AuthorUnitTest extends TestCase
{
use DatabaseMigrations;
use RefreshDatabase;
use WithFaker;
public function testItCanShowAnAuthor(): void
{
// Arrange
$author = factory(Author::class)->create();
// Act
$authorRepository = new AuthorRepository(new Author);
$found = $authorRepository->getById($author->id);
// Assert
$this->assertInstanceOf(Author::class, $found);
$this->assertEquals($found->api_id, $author->api_id);
$this->assertEquals($found->name, $author->name);
$this->assertEquals($found->short_name, $author->short_name);
$this->assertEquals($found->private_code, $author->private_code);
}
}
Errors:
1) Tests\Unit\AuthorUnitTest::testItCanShowAnAuthor
ReflectionException: Class request does not exist
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Container/Container.php:779
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Container/Container.php:658
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Container/Container.php:609
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:735
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Container/Container.php:1222
/Users/kirkster/Code/projects/personal/DemoSite/vendor/beyondcode/laravel-dump-server/src/DumpServerServiceProvider.php:48
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:574
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:75
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:550
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php:17
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:204
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:162
/Users/kirkster/Code/projects/personal/DemoSite/tests/CreatesApplication.php:18
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:91
/Users/kirkster/Code/projects/personal/DemoSite/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:68