Skip to content

Commit

Permalink
refs matomo-org#4121 added possibility to specify group as an argumen…
Browse files Browse the repository at this point in the history
…t like ./console tests Core
  • Loading branch information
tsteur committed Oct 4, 2013
1 parent c3bf94f commit aae467d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/CoreConsole/RunTests.php
Expand Up @@ -12,6 +12,7 @@
namespace Piwik\Plugins\CoreConsole;

use Piwik\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -25,12 +26,18 @@ protected function configure()
{
$this->setName('tests');
$this->setDescription('Run Piwik PHPUnit tests');
$this->addArgument('group', InputArgument::OPTIONAL, 'Optional test group', '');
$this->addOption('options', 'o', InputOption::VALUE_OPTIONAL, 'All options will be forwarded to phpunit', '');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$options = $input->getOption('options');
$group = $input->getArgument('group');

if (!empty($group)) {
$options = '--group ' . $group . ' ' . $options;
}

$cmd = sprintf('cd %s/tests/PHPUnit && phpunit %s', PIWIK_DOCUMENT_ROOT, $options);

Expand Down

0 comments on commit aae467d

Please sign in to comment.