Make WordPress Core


Ignore:
Timestamp:
10/21/2017 02:13:37 PM (7 years ago)
Author:
dd32
Message:

Tests: Return an exit code of 1 in the event that the database server for tests is unavailable.
This allows for automated scripts & test suites to handle the failure of the test suite easier.

Props danielbachhuber
Fixes #41916

File:
1 edited

Legend:

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

    r40263 r41966  
    116116}
    117117
     118function _wp_die_handler_filter_exit() {
     119    return '_wp_die_handler_exit';
     120}
     121
    118122function _wp_die_handler_txt( $message, $title, $args ) {
    119123    echo "\nwp_die called\n";
     
    126130        }
    127131    }
     132}
     133
     134function _wp_die_handler_exit( $message, $title, $args ) {
     135    echo "\nwp_die called\n";
     136    echo "Message : $message\n";
     137    echo "Title : $title\n";
     138    if ( ! empty( $args ) ) {
     139        echo "Args: \n";
     140        foreach( $args as $k => $v ){
     141            echo "\t $k : $v\n";
     142        }
     143    }
     144    exit( 1 );
    128145}
    129146
Note: See TracChangeset for help on using the changeset viewer.