Skip to content

Commit

Permalink
Minor changes to deprecated "robo test" command. (Use "composer test"…
Browse files Browse the repository at this point in the history
… instead.)
  • Loading branch information
greg-1-anderson committed May 22, 2020
1 parent 55d7075 commit 3e0afc2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions RoboFile.php
Expand Up @@ -16,6 +16,8 @@ public function test(array $args, $options =
'coverage' => false
])
{
$this->yell("Deprecated: use 'composer test' instead.");

$collection = $this->collectionBuilder();

$taskPHPUnit = $collection->taskPHPUnit();
Expand Down
22 changes: 14 additions & 8 deletions src/Task/Testing/Codecept.php
Expand Up @@ -34,6 +34,7 @@ class Codecept extends BaseTask implements CommandInterface, PrintedInterface
* @var string
*/
protected $command;
protected $providedPathToCodeception;

/**
* @param string $pathToCodeception
Expand All @@ -42,14 +43,7 @@ class Codecept extends BaseTask implements CommandInterface, PrintedInterface
*/
public function __construct($pathToCodeception = '')
{
$this->command = $pathToCodeception;
if (!$this->command) {
$this->command = $this->findExecutable('codecept');
}
if (!$this->command) {
throw new TaskException(__CLASS__, "Neither composer nor phar installation of Codeception found.");
}
$this->command .= ' run';
$this->providedPathToCodeception = $pathToCodeception;
}

/**
Expand Down Expand Up @@ -257,6 +251,18 @@ public function failGroup($failGroup)
*/
public function getCommand()
{
if (!$this->command) {
$this->command = $this->providedPathToCodeception;
if (!$this->command) {
$this->command = $this->findExecutable('codecept');
}
if (!$this->command) {
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
throw new TaskException(__CLASS__, "Neither composer nor phar installation of Codeception found.");
}
$this->command .= ' run';
}

return $this->command . $this->arguments;
}

Expand Down

0 comments on commit 3e0afc2

Please sign in to comment.