test: distinguish PHP diagnostics from prose

This commit is contained in:
chrnx committed 2026-08-12 22:08:15 -05:00
1 parent 52099a7ca1
commit 084c820716
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
export const phpDiagnosticPattern = export const phpDiagnosticPattern =
/(?:PHP\s+(?:Warning|Notice|Fatal error|Parse error|Deprecated)\b|(?:Warning|Notice|Fatal error|Parse error|Deprecated)\s*:|<b>\s*(?:Warning|Notice|Fatal error|Parse error|Deprecated)\s*<\/b>\s*:)/i; /(?:PHP\s+)?(?:(?:Warning|Notice|Fatal error|Parse error|Deprecated)|<b>\s*(?:Warning|Notice|Fatal error|Parse error|Deprecated)\s*<\/b>)\s*:/i;
export function containsPhpDiagnostic( responseBody ) { export function containsPhpDiagnostic( responseBody ) {
return phpDiagnosticPattern.test( responseBody ); return phpDiagnosticPattern.test( responseBody );
@@ -26,6 +26,10 @@ test( 'response diagnostics catch plain and display_errors PHP failures without
} }
for ( const prose of [ for ( const prose of [
'PHP Warning signs can make a story more useful.',
'PHP Notice board hangs beside the door.',
'PHP Deprecated Futures is the album title.',
'PHP Fatal error handling belongs at the boundary.',
'Warning signs can make a story more useful.', 'Warning signs can make a story more useful.',
'A notice board hangs beside the door.', 'A notice board hangs beside the door.',
'The album Deprecated Futures is available now.', 'The album Deprecated Futures is available now.',