-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
127 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ phpunit.xml | |
composer.lock | ||
behat.yml | ||
RoboFile.php | ||
/tests/sandbox/* | ||
/tests/sandbox/*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
command: | ||
setup: | ||
behat: | ||
options: | ||
source: "behat.yml.dist" | ||
destination: "behat.yml" | ||
phpunit: | ||
options: | ||
source: "phpunit.xml.dist" | ||
destination: "phpunit.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?php | ||
|
||
namespace EC\OpenEuropa\TaskRunner\Commands; | ||
|
||
use EC\OpenEuropa\TaskRunner\Tasks\ReplaceConfigTokens as ReplaceConfigTokens; | ||
use Symfony\Component\Console\Input\InputOption; | ||
|
||
/** | ||
* Class SetupCommands. | ||
* | ||
* @package EC\OpenEuropa\TaskRunner\Commands | ||
*/ | ||
class SetupCommands extends BaseCommands | ||
{ | ||
use ReplaceConfigTokens\loadTasks; | ||
|
||
/** | ||
* Setup Behat. | ||
* | ||
* This command will copy behat.yml.dist in behat.yml and replace | ||
* configuration tokens with values provided in runner.yml.dist/runner.yml. | ||
* | ||
* For example, given the following configuration: | ||
* | ||
* > drupal: | ||
* > root: build | ||
* | ||
* Then its token format would be: ${drupal.root} | ||
* | ||
* @command setup:behat | ||
* | ||
* @option source Source configuration file. | ||
* @option destination Destination configuration file. | ||
* | ||
* @aliases setup:b,sb | ||
* | ||
* @param array $options | ||
* | ||
* @return \Robo\Contract\TaskInterface | ||
*/ | ||
public function setupBehat(array $options = [ | ||
'source' => InputOption::VALUE_REQUIRED, | ||
'destination' => InputOption::VALUE_REQUIRED, | ||
]) | ||
{ | ||
return $this->taskReplaceConfigTokens($options['source'], $options['destination']); | ||
} | ||
|
||
/** | ||
* Setup PHPUnit. | ||
* | ||
* This command will copy phpunit.xml.dist in phpunit.xml and replace | ||
* configuration tokens with values provided in runner.yml.dist/runner.yml. | ||
* | ||
* For example, given the following configuration: | ||
* | ||
* > drupal: | ||
* > root: build | ||
* | ||
* Then its token format would be: ${drupal.root} | ||
* | ||
* @command setup:phpunit | ||
* | ||
* @option source Source configuration file. | ||
* @option destination Destination configuration file. | ||
* | ||
* @aliases setup:p,sp | ||
* | ||
* @param array $options | ||
* | ||
* @return \Robo\Contract\TaskInterface | ||
*/ | ||
public function setupPhpunit(array $options = [ | ||
'source' => InputOption::VALUE_REQUIRED, | ||
'destination' => InputOption::VALUE_REQUIRED, | ||
]) | ||
{ | ||
return $this->taskReplaceConfigTokens($options['source'], $options['destination']); | ||
} | ||
|
||
|
||
/** | ||
* Replace configuration tokens in a text file. | ||
* | ||
* This command will copy source file in destination file and replace | ||
* configuration tokens with values provided in runner.yml.dist/runner.yml. | ||
* | ||
* For example, given the following configuration: | ||
* | ||
* > drupal: | ||
* > root: build | ||
* | ||
* Then its token format would be: ${drupal.root} | ||
* | ||
* @command setup:replace | ||
* | ||
* @option source Source configuration file. | ||
* @option destination Destination configuration file. | ||
* | ||
* @aliases setup:p,sp | ||
* | ||
* @param array $options | ||
* | ||
* @return \Robo\Contract\TaskInterface | ||
*/ | ||
public function setupReplace(array $options = [ | ||
'source' => InputOption::VALUE_REQUIRED, | ||
'destination' => InputOption::VALUE_REQUIRED, | ||
]) | ||
{ | ||
return $this->taskReplaceConfigTokens($options['source'], $options['destination']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.