| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function testInheritEnv(CliGuy $I) |
||
| 26 | { |
||
| 27 | // With no environment variables set, test that we have a known variable |
||
| 28 | // such as PATH. |
||
| 29 | $task = $I->taskExec('env | grep -E "^PATH="')->interactive(false); |
||
| 30 | $result = $task->run(); |
||
| 31 | verify($result->getExitCode())->equals(\Robo\Result::EXITCODE_OK); |
||
| 32 | |||
| 33 | // Now run the same command, but this time set an environment variable |
||
| 34 | // on the task using ->env(). |
||
| 35 | $task = $I->taskExec('env | grep -E "^PATH="')->interactive(false); |
||
| 36 | $task->env('FOO', 'BAR'); |
||
| 37 | $result = $task->run(); |
||
| 38 | verify($result->getExitCode())->equals(\Robo\Result::EXITCODE_OK); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.