Skip to content

Commit a2206fd

Browse files
committed
Adds a filter option for running tests in the TestsCommand command.
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
1 parent 6882e94 commit a2206fd

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Command/TestsCommand.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ protected function configure(): void
7878
shortcut: 'c',
7979
mode: InputOption::VALUE_OPTIONAL,
8080
description: 'Whether to generate code coverage reports.',
81+
)
82+
->addOption(
83+
name: 'filter',
84+
shortcut: 'f',
85+
mode: InputOption::VALUE_OPTIONAL,
86+
description: 'Filter which tests to run based on a pattern.',
8187
);
8288
}
8389

@@ -126,6 +132,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
126132
$arguments[] = '--coverage-php=' . $this->resolvePath($input, 'coverage') . '/coverage.php';
127133
}
128134

135+
if ($input->getOption('filter')) {
136+
$arguments[] = '--filter=' . $input->getOption('filter');
137+
}
138+
129139
$command = new Process([...$arguments, $input->getArgument('path')]);
130140

131141
return parent::runProcess($command, $output);

0 commit comments

Comments
 (0)