Sanpi\Behatch\Context\SystemContext::ouputShouldNotContain PHP Method

ouputShouldNotContain() public method

Checks, that output not contains specified text.
public ouputShouldNotContain ( $text )
    public function ouputShouldNotContain($text)
    {
        $regex = '~' . $text . '~ui';
        foreach ($this->output as $line) {
            if (preg_match($regex, $line) === 1) {
                throw new \Exception(sprintf("The text '%s' was found somewhere on output of command.\n%s", $text, implode("\n", $this->output)));
            }
        }
    }