Skip to content

Commit f44ceb7

Browse files
Emit TestRunner\WarningTriggered events for warnings from loading the XML configuration file
1 parent f4a5027 commit f44ceb7

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/TextUI/Configuration/Merger.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,24 @@ public function merge(CliConfiguration $cliConfiguration, XmlConfiguration $xmlC
616616
$randomOrderSeed = time();
617617
}
618618

619-
if ($xmlConfiguration->wasLoadedFromFile() && $xmlConfiguration->hasValidationErrors()) {
620-
if ((new SchemaDetector)->detect($xmlConfiguration->filename())->detected()) {
621-
EventFacade::emitter()->testRunnerTriggeredDeprecation(
622-
'Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!',
623-
);
624-
} else {
625-
EventFacade::emitter()->testRunnerTriggeredWarning(
626-
"Test results may not be as expected because the XML configuration file did not pass validation:\n" .
627-
$xmlConfiguration->validationErrors(),
628-
);
619+
if ($xmlConfiguration->wasLoadedFromFile()) {
620+
if ($xmlConfiguration->hasValidationErrors()) {
621+
if ((new SchemaDetector)->detect($xmlConfiguration->filename())->detected()) {
622+
EventFacade::emitter()->testRunnerTriggeredDeprecation(
623+
'Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!',
624+
);
625+
} else {
626+
EventFacade::emitter()->testRunnerTriggeredWarning(
627+
"Test results may not be as expected because the XML configuration file did not pass validation:\n" .
628+
$xmlConfiguration->validationErrors(),
629+
);
630+
}
631+
}
632+
633+
if ($xmlConfiguration->hasWarnings()) {
634+
foreach ($xmlConfiguration->warnings() as $warning) {
635+
EventFacade::emitter()->testRunnerTriggeredWarning($warning);
636+
}
629637
}
630638
}
631639

0 commit comments

Comments
 (0)