1 | <?php |
||
11 | class CommandContext extends Context |
||
12 | { |
||
13 | /** |
||
14 | * @var StreamOutput |
||
15 | */ |
||
16 | private $output; |
||
17 | |||
18 | /** |
||
19 | * @var int |
||
20 | */ |
||
21 | private $exitCode; |
||
22 | |||
23 | /** |
||
24 | * @var \Exception |
||
25 | */ |
||
26 | private $exception; |
||
27 | |||
28 | /** |
||
29 | * @var Application |
||
30 | */ |
||
31 | private $application; |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function initialize(array $config, ContainerInterface $container) |
||
41 | |||
42 | /** |
||
43 | * @param string $command |
||
44 | * |
||
45 | * @When /^I run (.*)$/ |
||
46 | */ |
||
47 | public function iRunCommand($command) |
||
61 | |||
62 | /** |
||
63 | * @param int $code |
||
64 | * |
||
65 | * @throws \Exception |
||
66 | * |
||
67 | * @Then /^command should be successfully executed$/ |
||
68 | * @Then /^command exit code should be (?P<code>\-\d+|\d+)$/ |
||
69 | */ |
||
70 | public function commandExitCodeShouldBe($code = 0) |
||
82 | |||
83 | /** |
||
84 | * @param PyStringNode $message |
||
85 | * |
||
86 | * @throws \Exception |
||
87 | * |
||
88 | * @Then /^command should throw an exception$/ |
||
89 | * @Then /^command should throw following exception:?$/ |
||
90 | */ |
||
91 | public function commandShouldThrowException(PyStringNode $message = null) |
||
112 | |||
113 | /** |
||
114 | * @param PyStringNode $string |
||
115 | * |
||
116 | * @throws \Exception |
||
117 | * |
||
118 | * @Then /^command output should be like:?$/ |
||
119 | */ |
||
120 | public function commandOutputShouldBeLike(PyStringNode $string) |
||
135 | |||
136 | /** |
||
137 | * @return string |
||
138 | * |
||
139 | * @throws \Exception |
||
140 | */ |
||
141 | private function getRawCommandOutput() |
||
150 | } |
||
151 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.