| @@ 128-132 (lines=5) @@ | ||
| 125 | { |
|
| 126 | $regex = '~'.$text.'~ui'; |
|
| 127 | ||
| 128 | foreach ($this->output as $line) { |
|
| 129 | if (preg_match($regex, $line) === 1) { |
|
| 130 | throw new \Exception(sprintf("The text '%s' was found somewhere on output of command.\n%s", $text, implode("\n", $this->output))); |
|
| 131 | } |
|
| 132 | } |
|
| 133 | } |
|
| 134 | ||
| 135 | /** |
|
| @@ 141-145 (lines=5) @@ | ||
| 138 | public function outputShouldBe(PyStringNode $string) |
|
| 139 | { |
|
| 140 | $expected = $string->getStrings(); |
|
| 141 | foreach ($this->output as $index => $line) { |
|
| 142 | if ($line !== $expected[$index]) { |
|
| 143 | throw new \Exception(sprintf("instead of\n%s", implode("\n", $this->output))); |
|
| 144 | } |
|
| 145 | } |
|
| 146 | } |
|
| 147 | ||
| 148 | /** |
|