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
Copy file name to clipboardExpand all lines: app/sprinkles/core/src/Bakery/Test.php
+86-12Lines changed: 86 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -29,16 +29,23 @@ class Test extends BaseCommand
29
29
*/
30
30
protected$buildPath;
31
31
32
+
/**
33
+
* @var string
34
+
*/
35
+
protected$slashes = '\\';
36
+
32
37
/**
33
38
* {@inheritdoc}
34
39
*/
35
40
protectedfunctionconfigure()
36
41
{
37
42
$this->setName('test')
38
-
->addOption('coverage', 'c', InputOption::VALUE_NONE, 'Generate code coverage report in HTML format. Will be saved in _meta/coverage')
39
-
->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)")
->addOption('coverage-format', null, InputOption::VALUE_REQUIRED, 'Select test coverage format. Choose from html, clover, crap4j, php, text, xml, etc. Default to HTML.')
->addArgument('testscope', InputArgument::OPTIONAL, 'Test Scope can either be a sprinkle name or a test class (optional)')
40
47
->setDescription('Runs automated tests')
41
-
->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'`).");
48
+
->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 'UserFrosting\Sprinkle\SprinkleName\Tests\TestClass'`), as a specific test method (`php bakery test 'UserFrosting\Sprinkle\SprinkleName\Tests\TestClass::method'`).");
42
49
}
43
50
44
51
/**
@@ -54,26 +61,93 @@ protected function execute(InputInterface $input, OutputInterface $output)
54
61
$command .= ' -v';
55
62
}
56
63
64
+
// Process test scope
57
65
$testscope = $input->getArgument('testscope');
58
66
if ($testscope) {
59
-
$slashes = '\\\\';
60
-
if (strpos($testscope, '\\') !== false) {
61
-
$this->io->note("Executing Specified Test Scope : $testscope");
0 commit comments