Skip to content

Commit

Permalink
add deprecation warning when called with just a class name
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored and sebastianbergmann committed Dec 5, 2019
1 parent 194a983 commit bbc2ea9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,13 @@ protected function handleArguments(array $argv): void
$this->arguments['testSuffixes'] = ['Test.php', '.phpt'];
}

if (isset($this->options[1][0]) &&
\substr($this->options[1][0], -5, 5) !== '.phpt' &&
\substr($this->options[1][0], -4, 4) !== '.php'
) {
print 'Warning: Calling PHPUnit with a class name is deprecated and will be removed in PHPUnit 9.' . \PHP_EOL;
}

if (!isset($this->arguments['test'])) {
if (isset($this->options[1][0])) {
$this->arguments['test'] = $this->options[1][0];
Expand Down

0 comments on commit bbc2ea9

Please sign in to comment.