|
@@ 92-104 (lines=13) @@
|
| 89 |
|
$this->assertEquals('value', $actual); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
public function testWithConfigLoader() |
| 93 |
|
{ |
| 94 |
|
$loader = new YamlConfigLoader(); |
| 95 |
|
$loader->load(dirname(__DIR__) . '/_data/robo.yml'); |
| 96 |
|
|
| 97 |
|
\Robo\Robo::config()->import($loader->export()); |
| 98 |
|
|
| 99 |
|
$argv = ['placeholder', 'test:simple-list']; |
| 100 |
|
$result = $this->runner->execute($argv, null, null, $this->guy->capturedOutputStream()); |
| 101 |
|
|
| 102 |
|
$this->guy->seeInOutput("a: '12'"); |
| 103 |
|
$this->guy->seeInOutput("b: '13'"); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
public function testWithConfigLoaderAndCliOverride() |
| 107 |
|
{ |
|
@@ 106-118 (lines=13) @@
|
| 103 |
|
$this->guy->seeInOutput("b: '13'"); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
public function testWithConfigLoaderAndCliOverride() |
| 107 |
|
{ |
| 108 |
|
$loader = new YamlConfigLoader(); |
| 109 |
|
$loader->load(dirname(__DIR__) . '/_data/robo.yml'); |
| 110 |
|
|
| 111 |
|
\Robo\Robo::config()->import($loader->export()); |
| 112 |
|
|
| 113 |
|
$argv = ['placeholder', 'test:simple-list', '--b=3']; |
| 114 |
|
$result = $this->runner->execute($argv, null, null, $this->guy->capturedOutputStream()); |
| 115 |
|
|
| 116 |
|
$this->guy->seeInOutput("a: '12'"); |
| 117 |
|
$this->guy->seeInOutput("b: '3'"); |
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
public function testWithConfigProcessor() |
| 121 |
|
{ |
|
@@ 135-147 (lines=13) @@
|
| 132 |
|
$this->guy->seeInOutput("b: '13'"); |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
public function testCommandWithTaskConfiguration() |
| 136 |
|
{ |
| 137 |
|
$loader = new YamlConfigLoader(); |
| 138 |
|
$loader->load(dirname(__DIR__) . '/_data/robo.yml'); |
| 139 |
|
|
| 140 |
|
\Robo\Robo::config()->import($loader->export()); |
| 141 |
|
|
| 142 |
|
$argv = ['placeholder', 'test:exec', '--simulate']; |
| 143 |
|
$result = $this->runner->execute($argv, null, null, $this->guy->capturedOutputStream()); |
| 144 |
|
|
| 145 |
|
// `task.Base.Exec.settings.dir` is defined in loaded robo.yml configuration file. |
| 146 |
|
$this->guy->seeInOutput("->dir('/some/dir')"); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
public function testCommandWithFallbackTaskConfiguration() |
| 150 |
|
{ |
|
@@ 149-161 (lines=13) @@
|
| 146 |
|
$this->guy->seeInOutput("->dir('/some/dir')"); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
public function testCommandWithFallbackTaskConfiguration() |
| 150 |
|
{ |
| 151 |
|
$loader = new YamlConfigLoader(); |
| 152 |
|
$loader->load(dirname(__DIR__) . '/_data/falback-task-config-robo.yml'); |
| 153 |
|
|
| 154 |
|
\Robo\Robo::config()->import($loader->export()); |
| 155 |
|
|
| 156 |
|
$argv = ['placeholder', 'test:exec', '--simulate']; |
| 157 |
|
$result = $this->runner->execute($argv, null, null, $this->guy->capturedOutputStream()); |
| 158 |
|
|
| 159 |
|
// `task.Base.settings.dir` is defined in loaded robo.yml configuration file. |
| 160 |
|
$this->guy->seeInOutput("->dir('/some/other/dir')"); |
| 161 |
|
} |
| 162 |
|
} |
| 163 |
|
|