From 8fe0b7ef2310073aff3ed86b2eb7048ffc131eb3 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Mon, 15 Apr 2024 14:43:49 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Customize=E3=83=87=E3=82=A3=E3=83=AC?= =?UTF-8?q?=E3=82=AF=E3=83=88=E3=83=AA=E3=81=8B=E3=82=89Symfony=20Bundle?= =?UTF-8?q?=E3=82=92=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Kernel.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Eccube/Kernel.php b/src/Eccube/Kernel.php index 8a3b36e1ced..28702545519 100644 --- a/src/Eccube/Kernel.php +++ b/src/Eccube/Kernel.php @@ -110,6 +110,13 @@ public function registerBundles(): iterable } } } + + $contents = require $this->getProjectDir().'/app/Customize/Resource/config/bundles.php'; + foreach ($contents as $class => $envs) { + if (isset($envs['all']) || isset($envs[$this->environment])) { + yield new $class(); + } + } } /** From fb675343f30a0e84b20f777397840ac8e7ac4417 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Wed, 17 Apr 2024 19:23:32 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Customize=E3=83=87=E3=82=A3=E3=83=AC?= =?UTF-8?q?=E3=82=AF=E3=83=88=E3=83=AA=E3=81=ABbundles.php=E3=81=8C?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=81=8B=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Kernel.php | 85 ++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/src/Eccube/Kernel.php b/src/Eccube/Kernel.php index 28702545519..8cb84449a09 100644 --- a/src/Eccube/Kernel.php +++ b/src/Eccube/Kernel.php @@ -67,29 +67,29 @@ public function __construct(string $environment, bool $debug) public function getCacheDir(): string { - return $this->getProjectDir().'/var/cache/'.$this->environment; + return $this->getProjectDir() . '/var/cache/' . $this->environment; } public function getLogDir(): string { - return $this->getProjectDir().'/var/log'; + return $this->getProjectDir() . '/var/log'; } public function getConfigDir(): string { - return $this->getProjectDir().'/app/config/eccube'; + return $this->getProjectDir() . '/app/config/eccube'; } public function registerBundles(): iterable { - $contents = require $this->getProjectDir().'/app/config/eccube/bundles.php'; + $contents = require $this->getProjectDir() . '/app/config/eccube/bundles.php'; foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { yield new $class(); } } - $pluginDir = $this->getProjectDir().'/app/Plugin'; + $pluginDir = $this->getProjectDir() . '/app/Plugin'; $finder = (new Finder()) ->in($pluginDir) ->sortByName() @@ -100,7 +100,7 @@ public function registerBundles(): iterable }, iterator_to_array($finder)); foreach ($plugins as $code) { - $pluginBundles = $pluginDir.'/'.$code.'/Resource/config/bundles.php'; + $pluginBundles = $pluginDir . '/' . $code . '/Resource/config/bundles.php'; if (file_exists($pluginBundles)) { $contents = require $pluginBundles; foreach ($contents as $class => $envs) { @@ -111,10 +111,13 @@ public function registerBundles(): iterable } } - $contents = require $this->getProjectDir().'/app/Customize/Resource/config/bundles.php'; - foreach ($contents as $class => $envs) { - if (isset($envs['all']) || isset($envs[$this->environment])) { - yield new $class(); + $customizeBundles = $this->getProjectDir() . '/app/Customize/Resource/config/bundles.php'; + if (file_exists($customizeBundles)) { + $contents = require $customizeBundles; + foreach ($contents as $class => $envs) { + if (isset($envs['all']) || isset($envs[$this->environment])) { + yield new $class(); + } } } } @@ -159,23 +162,23 @@ public function boot() protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader) { - $confDir = $this->getProjectDir().'/app/config/eccube'; - $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob'); - if (is_dir($confDir.'/packages/'.$this->environment)) { - $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); + $confDir = $this->getProjectDir() . '/app/config/eccube'; + $loader->load($confDir . '/services' . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/packages/*' . self::CONFIG_EXTS, 'glob'); + if (is_dir($confDir . '/packages/' . $this->environment)) { + $loader->load($confDir . '/packages/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); } - $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/services_' . $this->environment . self::CONFIG_EXTS, 'glob'); // プラグインのservices.phpをロードする. - $dir = dirname(__DIR__).'/../app/Plugin/*/Resource/config'; - $loader->load($dir.'/services'.self::CONFIG_EXTS, 'glob'); - $loader->load($dir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob'); + $dir = dirname(__DIR__) . '/../app/Plugin/*/Resource/config'; + $loader->load($dir . '/services' . self::CONFIG_EXTS, 'glob'); + $loader->load($dir . '/services_' . $this->environment . self::CONFIG_EXTS, 'glob'); // カスタマイズディレクトリのservices.phpをロードする. - $dir = dirname(__DIR__).'/../app/Customize/Resource/config'; - $loader->load($dir.'/services'.self::CONFIG_EXTS, 'glob'); - $loader->load($dir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob'); + $dir = dirname(__DIR__) . '/../app/Customize/Resource/config'; + $loader->load($dir . '/services' . self::CONFIG_EXTS, 'glob'); + $loader->load($dir . '/services_' . $this->environment . self::CONFIG_EXTS, 'glob'); } protected function configureRoutes(RoutingConfigurator $routes) @@ -188,31 +191,31 @@ protected function configureRoutes(RoutingConfigurator $routes) $scheme = ['https']; } - $confDir = $this->getProjectDir().'/app/config/eccube'; - if (is_dir($confDir.'/routes/')) { - $builder = $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS); + $confDir = $this->getProjectDir() . '/app/config/eccube'; + if (is_dir($confDir . '/routes/')) { + $builder = $routes->import($confDir . '/routes/*' . self::CONFIG_EXTS); $builder->schemes($scheme); } - if (is_dir($confDir.'/routes/'.$this->environment)) { - $builder = $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS); + if (is_dir($confDir . '/routes/' . $this->environment)) { + $builder = $routes->import($confDir . '/routes/' . $this->environment . '/**/*' . self::CONFIG_EXTS); $builder->schemes($scheme); } - $builder = $routes->import($confDir.'/routes'.self::CONFIG_EXTS); + $builder = $routes->import($confDir . '/routes' . self::CONFIG_EXTS); $builder->schemes($scheme); - $builder = $routes->import($confDir.'/routes_'.$this->environment.self::CONFIG_EXTS); + $builder = $routes->import($confDir . '/routes_' . $this->environment . self::CONFIG_EXTS); $builder->schemes($scheme); // 有効なプラグインのルーティングをインポートする. $plugins = $container->getParameter('eccube.plugins.enabled'); - $pluginDir = $this->getProjectDir().'/app/Plugin'; + $pluginDir = $this->getProjectDir() . '/app/Plugin'; foreach ($plugins as $plugin) { - $dir = $pluginDir.'/'.$plugin.'/Controller'; + $dir = $pluginDir . '/' . $plugin . '/Controller'; if (file_exists($dir)) { - $builder = $routes->import($dir,'annotation'); + $builder = $routes->import($dir, 'annotation'); $builder->schemes($scheme); } - if (file_exists($pluginDir.'/'.$plugin.'/Resource/config')) { - $builder = $routes->import($pluginDir.'/'.$plugin.'/Resource/config/routes'.self::CONFIG_EXTS); + if (file_exists($pluginDir . '/' . $plugin . '/Resource/config')) { + $builder = $routes->import($pluginDir . '/' . $plugin . '/Resource/config/routes' . self::CONFIG_EXTS); $builder->schemes($scheme); } } @@ -285,7 +288,7 @@ protected function addEntityExtensionPass(ContainerBuilder $container) $namespaces = ['Eccube\\Entity']; $reader = new Reference('annotation_reader'); $driver = new Definition(AnnotationDriver::class, [$reader, $paths]); - $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir.'/app/proxy/entity']); + $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir . '/app/proxy/entity']); $container->addCompilerPass(new DoctrineOrmMappingsPass($driver, $namespaces, [])); // Customize @@ -295,7 +298,7 @@ protected function addEntityExtensionPass(ContainerBuilder $container) )); // Plugin - $pluginDir = $projectDir.'/app/Plugin'; + $pluginDir = $projectDir . '/app/Plugin'; $finder = (new Finder()) ->in($pluginDir) ->sortByName() @@ -306,12 +309,12 @@ protected function addEntityExtensionPass(ContainerBuilder $container) }, iterator_to_array($finder)); foreach ($plugins as $code) { - if (file_exists($pluginDir.'/'.$code.'/Entity')) { - $paths = ['%kernel.project_dir%/app/Plugin/'.$code.'/Entity']; - $namespaces = ['Plugin\\'.$code.'\\Entity']; + if (file_exists($pluginDir . '/' . $code . '/Entity')) { + $paths = ['%kernel.project_dir%/app/Plugin/' . $code . '/Entity']; + $namespaces = ['Plugin\\' . $code . '\\Entity']; $reader = new Reference('annotation_reader'); $driver = new Definition(AnnotationDriver::class, [$reader, $paths]); - $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir.'/app/proxy/entity']); + $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir . '/app/proxy/entity']); $container->addCompilerPass(new DoctrineOrmMappingsPass($driver, $namespaces, [])); } } @@ -326,7 +329,7 @@ protected function loadEntityProxies() } $files = Finder::create() - ->in(__DIR__.'/../../app/proxy/entity/') + ->in(__DIR__ . '/../../app/proxy/entity/') ->name('*.php') ->files(); foreach ($files as $file) { From 7b37702160a26e319970893e1c5972d8a2fad104 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Fri, 17 May 2024 11:03:29 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=82=92=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Kernel.php | 74 +++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/Eccube/Kernel.php b/src/Eccube/Kernel.php index 8cb84449a09..1623cbc9d61 100644 --- a/src/Eccube/Kernel.php +++ b/src/Eccube/Kernel.php @@ -67,29 +67,29 @@ public function __construct(string $environment, bool $debug) public function getCacheDir(): string { - return $this->getProjectDir() . '/var/cache/' . $this->environment; + return $this->getProjectDir().'/var/cache/'.$this->environment; } public function getLogDir(): string { - return $this->getProjectDir() . '/var/log'; + return $this->getProjectDir().'/var/log'; } public function getConfigDir(): string { - return $this->getProjectDir() . '/app/config/eccube'; + return $this->getProjectDir().'/app/config/eccube'; } public function registerBundles(): iterable { - $contents = require $this->getProjectDir() . '/app/config/eccube/bundles.php'; + $contents = require $this->getProjectDir().'/app/config/eccube/bundles.php'; foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { yield new $class(); } } - $pluginDir = $this->getProjectDir() . '/app/Plugin'; + $pluginDir = $this->getProjectDir().'/app/Plugin'; $finder = (new Finder()) ->in($pluginDir) ->sortByName() @@ -100,7 +100,7 @@ public function registerBundles(): iterable }, iterator_to_array($finder)); foreach ($plugins as $code) { - $pluginBundles = $pluginDir . '/' . $code . '/Resource/config/bundles.php'; + $pluginBundles = $pluginDir.'/'.$code.'/Resource/config/bundles.php'; if (file_exists($pluginBundles)) { $contents = require $pluginBundles; foreach ($contents as $class => $envs) { @@ -111,7 +111,7 @@ public function registerBundles(): iterable } } - $customizeBundles = $this->getProjectDir() . '/app/Customize/Resource/config/bundles.php'; + $customizeBundles = $this->getProjectDir().'/app/Customize/Resource/config/bundles.php'; if (file_exists($customizeBundles)) { $contents = require $customizeBundles; foreach ($contents as $class => $envs) { @@ -162,23 +162,23 @@ public function boot() protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader) { - $confDir = $this->getProjectDir() . '/app/config/eccube'; - $loader->load($confDir . '/services' . self::CONFIG_EXTS, 'glob'); - $loader->load($confDir . '/packages/*' . self::CONFIG_EXTS, 'glob'); - if (is_dir($confDir . '/packages/' . $this->environment)) { - $loader->load($confDir . '/packages/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); + $confDir = $this->getProjectDir().'/app/config/eccube'; + $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob'); + $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob'); + if (is_dir($confDir.'/packages/'.$this->environment)) { + $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); } - $loader->load($confDir . '/services_' . $this->environment . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob'); // プラグインのservices.phpをロードする. - $dir = dirname(__DIR__) . '/../app/Plugin/*/Resource/config'; - $loader->load($dir . '/services' . self::CONFIG_EXTS, 'glob'); - $loader->load($dir . '/services_' . $this->environment . self::CONFIG_EXTS, 'glob'); + $dir = dirname(__DIR__).'/../app/Plugin/*/Resource/config'; + $loader->load($dir.'/services'.self::CONFIG_EXTS, 'glob'); + $loader->load($dir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob'); // カスタマイズディレクトリのservices.phpをロードする. - $dir = dirname(__DIR__) . '/../app/Customize/Resource/config'; - $loader->load($dir . '/services' . self::CONFIG_EXTS, 'glob'); - $loader->load($dir . '/services_' . $this->environment . self::CONFIG_EXTS, 'glob'); + $dir = dirname(__DIR__).'/../app/Customize/Resource/config'; + $loader->load($dir.'/services'.self::CONFIG_EXTS, 'glob'); + $loader->load($dir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob'); } protected function configureRoutes(RoutingConfigurator $routes) @@ -191,31 +191,31 @@ protected function configureRoutes(RoutingConfigurator $routes) $scheme = ['https']; } - $confDir = $this->getProjectDir() . '/app/config/eccube'; - if (is_dir($confDir . '/routes/')) { - $builder = $routes->import($confDir . '/routes/*' . self::CONFIG_EXTS); + $confDir = $this->getProjectDir().'/app/config/eccube'; + if (is_dir($confDir.'/routes/')) { + $builder = $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS); $builder->schemes($scheme); } - if (is_dir($confDir . '/routes/' . $this->environment)) { - $builder = $routes->import($confDir . '/routes/' . $this->environment . '/**/*' . self::CONFIG_EXTS); + if (is_dir($confDir.'/routes/'.$this->environment)) { + $builder = $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS); $builder->schemes($scheme); } - $builder = $routes->import($confDir . '/routes' . self::CONFIG_EXTS); + $builder = $routes->import($confDir.'/routes'.self::CONFIG_EXTS); $builder->schemes($scheme); - $builder = $routes->import($confDir . '/routes_' . $this->environment . self::CONFIG_EXTS); + $builder = $routes->import($confDir.'/routes_'.$this->environment.self::CONFIG_EXTS); $builder->schemes($scheme); // 有効なプラグインのルーティングをインポートする. $plugins = $container->getParameter('eccube.plugins.enabled'); - $pluginDir = $this->getProjectDir() . '/app/Plugin'; + $pluginDir = $this->getProjectDir().'/app/Plugin'; foreach ($plugins as $plugin) { - $dir = $pluginDir . '/' . $plugin . '/Controller'; + $dir = $pluginDir.'/'.$plugin.'/Controller'; if (file_exists($dir)) { $builder = $routes->import($dir, 'annotation'); $builder->schemes($scheme); } - if (file_exists($pluginDir . '/' . $plugin . '/Resource/config')) { - $builder = $routes->import($pluginDir . '/' . $plugin . '/Resource/config/routes' . self::CONFIG_EXTS); + if (file_exists($pluginDir.'/'.$plugin.'/Resource/config')) { + $builder = $routes->import($pluginDir.'/'.$plugin.'/Resource/config/routes'.self::CONFIG_EXTS); $builder->schemes($scheme); } } @@ -288,7 +288,7 @@ protected function addEntityExtensionPass(ContainerBuilder $container) $namespaces = ['Eccube\\Entity']; $reader = new Reference('annotation_reader'); $driver = new Definition(AnnotationDriver::class, [$reader, $paths]); - $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir . '/app/proxy/entity']); + $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir.'/app/proxy/entity']); $container->addCompilerPass(new DoctrineOrmMappingsPass($driver, $namespaces, [])); // Customize @@ -298,7 +298,7 @@ protected function addEntityExtensionPass(ContainerBuilder $container) )); // Plugin - $pluginDir = $projectDir . '/app/Plugin'; + $pluginDir = $projectDir.'/app/Plugin'; $finder = (new Finder()) ->in($pluginDir) ->sortByName() @@ -309,12 +309,12 @@ protected function addEntityExtensionPass(ContainerBuilder $container) }, iterator_to_array($finder)); foreach ($plugins as $code) { - if (file_exists($pluginDir . '/' . $code . '/Entity')) { - $paths = ['%kernel.project_dir%/app/Plugin/' . $code . '/Entity']; - $namespaces = ['Plugin\\' . $code . '\\Entity']; + if (file_exists($pluginDir.'/'.$code.'/Entity')) { + $paths = ['%kernel.project_dir%/app/Plugin/'.$code.'/Entity']; + $namespaces = ['Plugin\\'.$code.'\\Entity']; $reader = new Reference('annotation_reader'); $driver = new Definition(AnnotationDriver::class, [$reader, $paths]); - $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir . '/app/proxy/entity']); + $driver->addMethodCall('setTraitProxiesDirectory', [$projectDir.'/app/proxy/entity']); $container->addCompilerPass(new DoctrineOrmMappingsPass($driver, $namespaces, [])); } } @@ -329,7 +329,7 @@ protected function loadEntityProxies() } $files = Finder::create() - ->in(__DIR__ . '/../../app/proxy/entity/') + ->in(__DIR__.'/../../app/proxy/entity/') ->name('*.php') ->files(); foreach ($files as $file) { From 1344831a590ac62ac888c5bc2b92751ea3230217 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Fri, 17 May 2024 11:04:15 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=82=92=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Eccube/Kernel.php b/src/Eccube/Kernel.php index 1623cbc9d61..8836f567f17 100644 --- a/src/Eccube/Kernel.php +++ b/src/Eccube/Kernel.php @@ -211,7 +211,7 @@ protected function configureRoutes(RoutingConfigurator $routes) foreach ($plugins as $plugin) { $dir = $pluginDir.'/'.$plugin.'/Controller'; if (file_exists($dir)) { - $builder = $routes->import($dir, 'annotation'); + $builder = $routes->import($dir,'annotation'); $builder->schemes($scheme); } if (file_exists($pluginDir.'/'.$plugin.'/Resource/config')) { From 6fad8c4fd815370e91713d40144ec603148aa532 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Mon, 20 May 2024 16:38:26 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Eccube/Tests/CustomizeBundleTest.php | 55 +++++++++++++++++++ .../Customize/Bundle/CustomizeBundle.php | 21 +++++++ .../Customize/Resource/config/bundles.php | 16 ++++++ 3 files changed, 92 insertions(+) create mode 100644 tests/Eccube/Tests/CustomizeBundleTest.php create mode 100644 tests/Fixtures/Customize/Bundle/CustomizeBundle.php create mode 100644 tests/Fixtures/Customize/Resource/config/bundles.php diff --git a/tests/Eccube/Tests/CustomizeBundleTest.php b/tests/Eccube/Tests/CustomizeBundleTest.php new file mode 100644 index 00000000000..b213fa2c187 --- /dev/null +++ b/tests/Eccube/Tests/CustomizeBundleTest.php @@ -0,0 +1,55 @@ +remove(__DIR__.'/../../../app/Customize/Bundle'); + $fs->remove(__DIR__.'/../../../app/Customize/Resource/config/bundles.php'); + } + + public function testContainsCustomizeBundle() + { + $fs = new Filesystem(); + $originDir = __DIR__.'/../../Fixtures/Customize'; + $targetDir = __DIR__.'/../../../app/Customize'; + $fs->mirror($originDir, $targetDir); + + $kernel = static::bootKernel(); + $bundleNames = []; + foreach ($kernel->getBundles() as $bundle) { + $bundleNames[] = get_class($bundle); + } + + self::assertContains(CustomizeBundle::class, $bundleNames); + } + + public function testNotContainsCustomizeBundle() + { + $kernel = static::bootKernel(); + $bundleNames = []; + foreach ($kernel->getBundles() as $bundle) { + $bundleNames[] = get_class($bundle); + } + + self::assertNotContains(CustomizeBundle::class, $bundleNames); + } +} diff --git a/tests/Fixtures/Customize/Bundle/CustomizeBundle.php b/tests/Fixtures/Customize/Bundle/CustomizeBundle.php new file mode 100644 index 00000000000..d05b4aaeb6c --- /dev/null +++ b/tests/Fixtures/Customize/Bundle/CustomizeBundle.php @@ -0,0 +1,21 @@ + ['all' => true], +]; From 6350e49cb7faf914e42b69ad07d64be4c4cc2de1 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Mon, 20 May 2024 17:37:41 +0900 Subject: [PATCH 6/6] fix --- tests/Eccube/Tests/CustomizeBundleTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Eccube/Tests/CustomizeBundleTest.php b/tests/Eccube/Tests/CustomizeBundleTest.php index b213fa2c187..23bc253a3a2 100644 --- a/tests/Eccube/Tests/CustomizeBundleTest.php +++ b/tests/Eccube/Tests/CustomizeBundleTest.php @@ -24,6 +24,8 @@ public function tearDown(): void $fs = new Filesystem(); $fs->remove(__DIR__.'/../../../app/Customize/Bundle'); $fs->remove(__DIR__.'/../../../app/Customize/Resource/config/bundles.php'); + + parent::tearDown(); } public function testContainsCustomizeBundle()