Skip to content

Commit 1b7b3d3

Browse files
committed
Fixing testing
1 parent a606c0f commit 1b7b3d3

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

packages/container/src/GenericContainer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function __construct(
4343
private(set) ArrayIterator $decorators = new ArrayIterator(),
4444
private(set) ?DependencyChain $chain = null,
4545
) {
46-
GenericContainer::setInstance($this);
4746
$this->singleton(Container::class, $this);
4847
$this->singleton(ContainerInterface::class, $this);
4948
$this->singleton(GenericContainer::class, $this);

packages/core/src/Commands/DiscoveryGenerateCommand.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ public function __invoke(): void
4545

4646
$this->clearDiscoveryCache();
4747

48-
$this->generateDiscoveryCache($strategy, fn () => null);
49-
// $this->console->task(
50-
// label: "Generating discovery cache using the `{$strategy->value}` strategy",
51-
// handler: fn (Closure $log) => $this->generateDiscoveryCache($strategy, $log),
52-
// );
48+
$this->console->task(
49+
label: "Generating discovery cache using the `{$strategy->value}` strategy",
50+
handler: fn (Closure $log) => $this->generateDiscoveryCache($strategy, $log),
51+
);
5352
}
5453

5554
public function clearDiscoveryCache(): void

packages/core/src/FrameworkKernel.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(
4040
?Container $container = null,
4141
?string $internalStorage = null,
4242
) {
43-
$this->container = $container ?? new GenericContainer();
43+
$this->container = $container ?? $this->createContainer();
4444
$this->registry = new Registry(locations: $discoveryLocations);
4545

4646
if ($internalStorage !== null) {
@@ -78,6 +78,15 @@ public static function boot(
7878
->event(KernelEvent::BOOTED);
7979
}
8080

81+
public function createContainer(): GenericContainer
82+
{
83+
$container = new GenericContainer();
84+
85+
GenericContainer::setInstance($container);
86+
87+
return $container;
88+
}
89+
8190
public function validateRoot(): self
8291
{
8392
$root = Filesystem\normalize_path($this->root);

0 commit comments

Comments
 (0)