You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
->addOption('coverage', 'c', InputOption::VALUE_NONE, 'Generate code coverage report in HTML format. Will be saved in _meta/coverage')
36
-
->setDescription('Run tests')
37
-
->setHelp('Run php unit tests');
38
+
->addArgument('testscope', InputArgument::OPTIONAL, "Test Scope can either be a sprinkle name or a class formated as 'SprinkleName\Tests\TestClass` or 'SprinkleName\Tests\TestClass::method` (Optional)")
39
+
->setDescription('Runs automated tests')
40
+
->setHelp("Run PHP unit tests. Tests from a specific sprinkle can optionally be run using the 'testscope' argument (`php bakery test SprinkleName`). A specific test class can also be be run using the testscope argument (`php bakery test 'SprinkleName\Tests\TestClass'`), as a specific test method (`php bakery test 'SprinkleName\Tests\TestClass::method'`).");
38
41
}
39
42
40
43
/**
@@ -50,6 +53,19 @@ protected function execute(InputInterface $input, OutputInterface $output)
50
53
$command .= ' -v';
51
54
}
52
55
56
+
$testscope = $input->getArgument('testscope');
57
+
if ($testscope) {
58
+
$slashes = '\\\\';
59
+
if (strpos($testscope, '\\') !== false) {
60
+
$this->io->note("Executing Specified Test Scope : $testscope");
0 commit comments