Skip to content

Commit

Permalink
Add --test-ext cli argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jubianchi committed Feb 27, 2015
1 parent 538cc0c commit d688c71
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions classes/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function __construct(atoum\configurator $configurator = null)
if ($configurator)
{
$script = $configurator->getScript();
$parser = $script->getArgumentsParser();
$extension = $this;
$handler = function(atoum\scripts\runner $script, $argument, $values) use ($extension) {
if (sizeof($values) != 1)
Expand All @@ -39,16 +38,18 @@ public function __construct(atoum\configurator $configurator = null)
$extension->setRule($value);
};

$example = <<<EOF
'not("featureA" in tags) and namespace = "foo\bar"'
EOF;
$testHandler = function($script, $argument, $values) {
$script->getRunner()->addTestsFromDirectory(dirname(__DIR__) . '/tests/units/classes');
};

$script
$script
->addArgumentHandler($testHandler, array('--test-ext'))
->addArgumentHandler($testHandler, array('--test-it'))
->addArgumentHandler(
$handler,
array('--filter'),
null,
$script->getLocale()->_('Filters tests to execute. For example ' . $example)
$script->getLocale()->_('Filters tests to execute. For example \'not("featureA" in tags) and namespace = "foo\bar"\'')
)
;
}
Expand Down

0 comments on commit d688c71

Please sign in to comment.