#!/bin/bash # CI only: fails if a server log holds any PHP warning, notice, deprecation or # error, in PHP's own format ("PHP Warning: ...") or helpers/ErrorHandler.php's # ("[...] [WARNING] ..."). A page can render fine while logging these: the # E_STRICT deprecation and "Array to string conversion" in #130 did. # # tests/ci/php-warnings.sh .ui-stack/server.log set -euo pipefail LOG=${1:?server log} PATTERN='\[(WARNING|NOTICE|DEPRECATED|USER_WARNING|USER_NOTICE|USER_DEPRECATED|RECOVERABLE_ERROR|ERROR|FATAL|PARSE|CORE_ERROR|COMPILE_ERROR)\]|PHP (Warning|Notice|Deprecated|Fatal error|Parse error)' if grep -E "$PATTERN" "$LOG"; then echo "::error::PHP logged the warnings, notices or errors above while serving the tests ($LOG)." exit 1 fi echo "No PHP warnings, notices or errors in $LOG"