TextExpectation::describeTextMatch PHP Method

describeTextMatch() protected method

Describes a pattern match including the string found and it's position.
protected describeTextMatch ( string $substring, string $subject )
$substring string Text to search for.
$subject string Subject to search.
    protected function describeTextMatch($substring, $subject)
    {
        $position = strpos($subject, $substring);
        $dumper = $this->getDumper();
        return "Text [{$substring}] detected at character [{$position}] in [" . $dumper->describeValue($subject) . '] in region [' . $dumper->clipString($subject, 100, $position) . ']';
    }