Code Duplication    Length = 5-5 lines in 2 locations

src/Context/SystemContext.php 2 locations

@@ 138-142 (lines=5) @@
135
    {
136
        $regex = '~'.$text.'~ui';
137
138
        foreach ($this->output as $line) {
139
            if (preg_match($regex, $line) === 1) {
140
                throw new \Exception(sprintf("The text '%s' was found somewhere on output of command.\n%s", $text, implode("\n", $this->output)));
141
            }
142
        }
143
    }
144
145
    /**
@@ 151-155 (lines=5) @@
148
    public function outputShouldBe(PyStringNode $string)
149
    {
150
        $expected = $string->getStrings();
151
        foreach ($this->output as $index => $line) {
152
            if ($line !== $expected[$index]) {
153
                throw new \Exception(sprintf("instead of\n%s", implode("\n", $this->output)));
154
            }
155
        }
156
    }
157
158
    /**