Merge pull request #1661 from Avnsh1111/fix/opposite-expectation-truncated-message

fix: preserve full error message in not() expectation failures
This commit is contained in:
nuno maduro
2026-04-10 11:48:24 +01:00
committed by GitHub
3 changed files with 29 additions and 4 deletions

View File

@ -86,4 +86,17 @@ final readonly class Exporter
return (string) preg_replace(array_keys($map), array_values($map), $this->exporter->shortenedExport($value));
}
/**
* Exports a value into a full single-line string without truncation.
*/
public function export(mixed $value): string
{
$map = [
'#\\\n\s*#' => '',
'# Object \(\.{3}\)#' => '',
];
return (string) preg_replace(array_keys($map), array_values($map), $this->exporter->export($value));
}
}