test: distinguish PHP diagnostics from prose
This commit is contained in:
2 files changed
+5
-1
No files matched your search
@@ -1,5 +1,5 @@
|
||||
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 ) {
|
||||
return phpDiagnosticPattern.test( responseBody );
|
||||
|
||||
@@ -26,6 +26,10 @@ test( 'response diagnostics catch plain and display_errors PHP failures without
|
||||
}
|
||||
|
||||
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.',
|
||||
'A notice board hangs beside the door.',
|
||||
'The album Deprecated Futures is available now.',
|
||||
|
||||
Reference in new issue
Block a user