When running lighthouse test case, an error is reported: classoverTrue\LaravelVersionABLE\ServiceProviderNot found
1. When running the test case of lighthouse, an error is reported: classoverTrue\LaravelVersionABLE\ServiceProvidernot found. as shown in Figure 1
PS E:\wwwroot\object> ./vendor/bin/phpunit .\Modules\ThemeStore\Tests\Functional\GraphQl\OnlineStoreThemeGraphQlApiTest.php
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 350 ms, Memory: 30.00 MB
There was 1 error:
1) Modules\ThemeStore\Tests\Functional\GraphQl\OnlineStoreThemeGraphQlApiTest::testGetThemeById
Error: Class 'Overtrue\LaravelVersionable\ServiceProvider' not found
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:208
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:144
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:61
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:593
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterProviders.php:17
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:219
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:320
E:\wwwroot\object\tests\CreatesApplication.php:18
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Testing\TestCase.php:102
E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Testing\TestCase.php:81
E:\wwwroot\object\Modules\ThemeStore\Tests\Functional\GraphQl\OnlineStoreThemeGraphQlApiTest.php:76
phpvfscomposer://E:\wwwroot\object\vendor\phpunit\phpunit\phpunit:60
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
PS E:\wwwroot\object>
2. Search the class in the IDE: overtrue\LaravelVelVersionable\ServiceProvider, not found. as shown in Figure 2
3. Find the code in the project: LaravelVersionable, find the file /bootstrap/cache/packages.phpunit.php exists in: overtrue\\LaravelVersionable\\ServiceProvider . as shown in Figure 3
4. View the directory: /vendor/overtrue, the folder laravel-versionable does not exist. Confirm that this package is not installed, but is declared in the cache. as shown in Figure 4
5. Check the existing cache files under /bootstrap/cache, as shown in Figure 5
6. The reason should be that the local reset of git has been carried out before, which in turn leads to an error in the cache. The cache should not be put into git. I finally decided to manually delete the cache files under the directory /bootstrap/cache. Run the test, the test passes. as shown in Figure 6
PS E:\wwwroot\object> ./vendor/bin/phpunit .\Modules\ThemeStore\Tests\Functional\GraphQl\OnlineStoreThemeGraphQlApiTest.php
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
Time: 9.42 seconds, Memory: 60.00 MB
OK (1 test, 14 assertions)
PS E:\wwwroot\object>





