Skip to content

Commit d12b496

Browse files
committed
Build/Test Tools: Apply formatting to wp_die() output during PHPUnit test runs.
This makes the output more legible in the terminal. See #63167 git-svn-id: https://develop.svn.wordpress.org/trunk@61083 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 97009ac commit d12b496

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/phpunit/includes/functions.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,13 @@ function _wp_die_handler_filter_exit() {
227227
function _wp_die_handler_txt( $message, $title, $args ) {
228228
list( $message, $title, $args ) = _wp_die_process_input( $message, $title, $args );
229229

230+
$message = html_entity_decode( strip_tags( $message ) );
231+
$title = html_entity_decode( strip_tags( $title ) );
232+
233+
echo "\033[0;31m";
230234
echo "\nwp_die() called\n";
231235
echo "Message: $message\n";
236+
echo "\033[0m";
232237

233238
if ( ! empty( $title ) ) {
234239
echo "Title: $title\n";
@@ -259,8 +264,13 @@ function _wp_die_handler_txt( $message, $title, $args ) {
259264
function _wp_die_handler_exit( $message, $title, $args ) {
260265
list( $message, $title, $args ) = _wp_die_process_input( $message, $title, $args );
261266

267+
$message = html_entity_decode( strip_tags( $message ) );
268+
$title = html_entity_decode( strip_tags( $title ) );
269+
270+
echo "\033[0;31m";
262271
echo "\nwp_die() called\n";
263272
echo "Message: $message\n";
273+
echo "\033[0m";
264274

265275
if ( ! empty( $title ) ) {
266276
echo "Title: $title\n";

0 commit comments

Comments
 (0)