lithium\test\Unit::_normalizeLineEndings PHP Метод

_normalizeLineEndings() защищенный Метод

On linux EOL is LF, on Windows it is normally CRLF, but the latter may depend also on the git config core.autocrlf setting. As some tests use heredoc style (<<<) to specify multiline expectations, this EOL issue may cause tests to fail only because of a difference in EOL's used. in assertEqual, assertNotEqual, assertPattern and assertNotPattern this function is called to get rid of any EOL differences.
protected _normalizeLineEndings ( mixed $expected, mixed $result ) : array
$expected mixed
$result mixed
Результат array Array with the normalized elements i.e. `array($expected, $result)`.
    protected function _normalizeLineEndings($expected, $result)
    {
        if (is_string($expected) && is_string($result)) {
            $expected = preg_replace('/\\r\\n/', "\n", $expected);
            $result = preg_replace('/\\r\\n/', "\n", $result);
        }
        return array($expected, $result);
    }