Skip to content

Commit 464ed56

Browse files
Improve warning message when defaultTestSuite attribute is used on the <phpunit> element in the XML configuration file together with the --list-suites CLI option
1 parent 63d4286 commit 464ed56

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/TextUI/Command/Commands/ListTestSuitesCommand.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ private function warnAboutConflictingOptions(): string
7070

7171
$configuration = Registry::get();
7272

73+
if ($configuration->hasDefaultTestSuite()) {
74+
$buffer .= 'The defaultTestSuite (XML) and --list-suites (CLI) options cannot be combined, only the default test suite is shown' . PHP_EOL;
75+
}
76+
77+
if ($configuration->includeTestSuite() !== '' && !$configuration->hasDefaultTestSuite()) {
78+
$buffer .= 'The --testsuite and --list-suites options cannot be combined, --testsuite is ignored' . PHP_EOL;
79+
}
80+
7381
if ($configuration->hasFilter()) {
7482
$buffer .= 'The --filter and --list-suites options cannot be combined, --filter is ignored' . PHP_EOL;
7583
}
@@ -82,10 +90,6 @@ private function warnAboutConflictingOptions(): string
8290
$buffer .= 'The --exclude-group and --list-suites options cannot be combined, --exclude-group is ignored' . PHP_EOL;
8391
}
8492

85-
if ($configuration->includeTestSuite() !== '') {
86-
$buffer .= 'The --testsuite and --list-suites options cannot be combined, --testsuite is ignored' . PHP_EOL;
87-
}
88-
8993
if (!empty($buffer)) {
9094
$buffer .= PHP_EOL;
9195
}

0 commit comments

Comments
 (0)