diff --git a/src/Services/UpgradeManager.php b/src/Services/UpgradeManager.php index 47da5ce..6ad86d1 100644 --- a/src/Services/UpgradeManager.php +++ b/src/Services/UpgradeManager.php @@ -61,7 +61,11 @@ public function run(RunConfiguration $configuration, OutputInterface $output): v } $this->processHelper->console(['plugin:refresh']); - $this->processHelper->console(['theme:refresh']); + + if ($this->state->isStorefrontInstalled()) { + $this->processHelper->console(['theme:refresh']); + } + $this->processHelper->console(['scheduled-task:register']); $this->processHelper->console(['messenger:setup-transports']); diff --git a/tests/Services/UpgradeManagerTest.php b/tests/Services/UpgradeManagerTest.php index 451c27e..b49f042 100644 --- a/tests/Services/UpgradeManagerTest.php +++ b/tests/Services/UpgradeManagerTest.php @@ -124,7 +124,7 @@ public function testRunUpdatesVersionNoAssetCompile(): void $manager->run(new RunConfiguration(true, true), $this->createMock(OutputInterface::class)); - static::assertCount(5, $consoleCommands); + static::assertCount(4, $consoleCommands); static::assertSame(['system:update:finish', '--skip-asset-build'], $consoleCommands[0]); } @@ -133,7 +133,7 @@ public function testRunWithDifferentSalesChannelUrl(): void { $state = $this->createMock(ShopwareState::class); $state - ->expects($this->once()) + ->expects($this->exactly(2)) ->method('isStorefrontInstalled') ->willReturn(true); @@ -206,10 +206,10 @@ public function testRunWithMaintenanceMode(): void $manager->run(new RunConfiguration(), $this->createMock(OutputInterface::class)); - static::assertCount(7, $consoleCommands); + static::assertCount(6, $consoleCommands); static::assertSame(['cache:pool:clear', 'cache.http', 'cache.object'], $consoleCommands[0]); static::assertArrayHasKey(5, $consoleCommands); - static::assertSame(['cache:pool:clear', 'cache.http', 'cache.object'], $consoleCommands[6]); + static::assertSame(['cache:pool:clear', 'cache.http', 'cache.object'], $consoleCommands[5]); } public function testRunWithLicenseDomain(): void