Skip to content

Commit 3e0afc2

Browse files
Minor changes to deprecated "robo test" command. (Use "composer test" instead.)
1 parent 55d7075 commit 3e0afc2

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

RoboFile.php

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public function test(array $args, $options =
1616
'coverage' => false
1717
])
1818
{
19+
$this->yell("Deprecated: use 'composer test' instead.");
20+
1921
$collection = $this->collectionBuilder();
2022

2123
$taskPHPUnit = $collection->taskPHPUnit();

src/Task/Testing/Codecept.php

+14-8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Codecept extends BaseTask implements CommandInterface, PrintedInterface
3434
* @var string
3535
*/
3636
protected $command;
37+
protected $providedPathToCodeception;
3738

3839
/**
3940
* @param string $pathToCodeception
@@ -42,14 +43,7 @@ class Codecept extends BaseTask implements CommandInterface, PrintedInterface
4243
*/
4344
public function __construct($pathToCodeception = '')
4445
{
45-
$this->command = $pathToCodeception;
46-
if (!$this->command) {
47-
$this->command = $this->findExecutable('codecept');
48-
}
49-
if (!$this->command) {
50-
throw new TaskException(__CLASS__, "Neither composer nor phar installation of Codeception found.");
51-
}
52-
$this->command .= ' run';
46+
$this->providedPathToCodeception = $pathToCodeception;
5347
}
5448

5549
/**
@@ -257,6 +251,18 @@ public function failGroup($failGroup)
257251
*/
258252
public function getCommand()
259253
{
254+
if (!$this->command) {
255+
$this->command = $this->providedPathToCodeception;
256+
if (!$this->command) {
257+
$this->command = $this->findExecutable('codecept');
258+
}
259+
if (!$this->command) {
260+
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
261+
throw new TaskException(__CLASS__, "Neither composer nor phar installation of Codeception found.");
262+
}
263+
$this->command .= ' run';
264+
}
265+
260266
return $this->command . $this->arguments;
261267
}
262268

0 commit comments

Comments
 (0)