Make WordPress Core

Changeset 61083


Ignore:
Timestamp:
10/28/2025 04:52:53 PM (7 weeks ago)
Author:
johnbillion
Message:

Build/Test Tools: Apply formatting to wp_die() output during PHPUnit test runs.

This makes the output more legible in the terminal.

See #63167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/functions.php

    r61063 r61083  
    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 ) ) {
     
    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 ) ) {
Note: See TracChangeset for help on using the changeset viewer.