Open shanginn opened 1 month ago
On the fresh spiral framework install in the config/cache.php local driver for cache is defined as
'local' => [ // Alias for ArrayStorage type 'type' => 'array', ],
But the alias itself is missing or not working properly, because when running default tests the error is thrown:
[Spiral\Core\Exception\Container\NotFoundException] Can't resolve `Spiral\Scheduler\JobsLocatorInterface`: undefined class or binding `array`. Container trace list: - action: 'resolve from binding' alias: 'Spiral\Scheduler\JobsLocatorInterface' scope: 'root' context: Parameter #0 [ <required> Spiral\Scheduler\JobsLocatorInterface $locator ] binding: Alias to `Spiral\Scheduler\JobsLocator` - action: 'resolve from binding' alias: 'Spiral\Scheduler\JobsLocator' scope: 'root' context: Parameter #0 [ <required> Spiral\Scheduler\JobsLocatorInterface $locator ] binding: Deferred factory 'Spiral\Scheduler\Bootloader\SchedulerBootloader'->initJobsLocator() - action: 'resolve from binding' alias: 'Spiral\Scheduler\Mutex\JobMutexInterface' scope: 'root' context: Parameter #1 [ <required> Spiral\Scheduler\Mutex\JobMutexInterface $mutex ] binding: Deferred factory 'Spiral\Scheduler\Bootloader\SchedulerBootloader'->initEventMutex() - action: 'autowire' alias: 'array' context: null in vendor/spiral/framework/src/Core/src/Internal/Factory.php:359
The fix that worked for me is just to replace it with the class itself:
'local' => [ 'type' => ArrayStorage::class, ],
Repo with the problem present. Just run phpunit and you will get the error
phpunit
Install log and phpunit run with error
Description
On the fresh spiral framework install in the config/cache.php local driver for cache is defined as
But the alias itself is missing or not working properly, because when running default tests the error is thrown:
The fix that worked for me is just to replace it with the class itself:
How To Reproduce
Repo with the problem present. Just run
phpunit
and you will get the errorInstall log and phpunit run with error
Additional Info