Skip to content

Commit

Permalink
Fix register stub commands pass
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Oct 16, 2024
1 parent 99eb23f commit 8676981
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public function process(ContainerBuilder $container): void
{
if (!$this->isMakerEnabled($container)) {
$container->register(StubMakeGrid::class)->setClass(StubMakeGrid::class)->addTag('console.command');
$container->removeDefinition(MakeGrid::class);
$container->removeAlias('sylius.grid.maker');
$container->removeDefinition('sylius.grid.maker');
$container->removeAlias(MakeGrid::class);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ public function it_does_not_register_stub_commands_when_maker_is_registered(): v
/** @test */
public function it_unregisters_definition_for_grid_maker_when_maker_is_not_registered(): void
{
$this->registerService(MakeGrid::class, MakeGrid::class);
$this->registerService('sylius.grid.maker', MakeGrid::class);

$this->compile();

$this->assertContainerBuilderNotHasService(MakeGrid::class);
$this->assertContainerBuilderNotHasService('sylius.grid.maker');
}

/** @test */
public function it_does_not_unregister_definition_for_grid_maker_when_maker_is_registered(): void
{
$this->setParameter('kernel.bundles', [MakerBundle::class]);
$this->registerService(MakeGrid::class, MakeGrid::class);
$this->registerService('sylius.grid.maker', MakeGrid::class);

$this->compile();

$this->assertContainerBuilderHasService(MakeGrid::class, MakeGrid::class);
$this->assertContainerBuilderHasService('sylius.grid.maker', MakeGrid::class);
}

protected function registerCompilerPass(ContainerBuilder $container): void
Expand Down

0 comments on commit 8676981

Please sign in to comment.