Вызов Config::get('promocodes') вызывает ошибку
RuntimeException : A facade root has not been set.
Как это исправить?
class ProductRepositoryTest extends TestCase
{
protected $productRepository;
protected function setUp(): void
{
$this->productRepository = new ProductRepository(
Product::class,
new ColorRepository(Color::class),
new TagRepository(Tag::class),
new PromocodeService(Config::get('promocodes')),
new InstallmentService()
);
}
/** @test */
public function get_correct_product_by_id()
{
$product = $this->productRepository->get(1);
$this->assertEquals(1, $product->id);
}
}