From d5b43d1f2d6adcf0b4e23d3f9a6c1054e541c4ed Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Tue, 12 May 2026 07:43:50 +0200 Subject: [PATCH] fix: phpunit bootstrap plugin install order --- tests/TestBootstrap.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/TestBootstrap.php b/tests/TestBootstrap.php index fbe4d5ca..1bfc7820 100644 --- a/tests/TestBootstrap.php +++ b/tests/TestBootstrap.php @@ -17,10 +17,20 @@ exit('Could not find TestBootstrapper.php'); } +$projectDir = $_SERVER['PROJECT_ROOT'] ?? dirname(__DIR__, 4); + +// Install dependency first: calling plugins install hook needs Assistant schema +(new TestBootstrapper()) + ->setProjectDir($projectDir) + ->setLoadEnvFile(true) + ->addActivePlugins('SwagMigrationAssistant') + ->bootstrap(); + return (new TestBootstrapper()) - ->setProjectDir($_SERVER['PROJECT_ROOT'] ?? dirname(__DIR__, 4)) + ->setProjectDir($projectDir) ->setLoadEnvFile(true) - ->addActivePlugins('SwagMigrationAssistant', 'SwagMigrationMagento') + ->setForceInstall(false) + ->setForceInstallPlugins(true) ->addCallingPlugin() ->bootstrap() ->setClassLoader(require dirname(__DIR__) . '/vendor/autoload.php')