From cd0fefb8b5c2a13f5fb8062165fad82482a3c207 Mon Sep 17 00:00:00 2001 From: manishranjan-adobe Date: Wed, 9 Oct 2024 19:36:26 +0530 Subject: [PATCH] Allure PHPUnit extension is not recognising the parameter path if the phpunit.xml.dist is placed in a different directory than root --- src/AllureExtension.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/AllureExtension.php b/src/AllureExtension.php index 5dda14d..179bbb5 100644 --- a/src/AllureExtension.php +++ b/src/AllureExtension.php @@ -92,9 +92,16 @@ private function loadConfigData(?string $configFile): array public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void { - $configSource = $parameters->has('config') - ? $parameters->get('config') - : null; + if ($configuration->hasConfigurationFile()) { + $path = dirname($configuration->configurationFile()); + $configSource = $parameters->has('config') + ? $path . DIRECTORY_SEPARATOR . $parameters->get('config') + : null; + } else { + $configSource = $parameters->has('config') + ? $parameters->get('config') + : null; + } $testLifecycle = $this->testLifecycle ?? $this->createTestLifecycle($configSource);