WordPress.org

Make WordPress Core

Changeset 37071


Ignore:
Timestamp:
03/23/2016 07:00:38 PM (5 years ago)
Author:
boonebgorges
Message:

Tests: Ensure that the default wp_die() handler can handle a WP_Error object.

Props dd32, utkarshpatel.
Fixes #36166.

Location:
trunk/tests/phpunit
Files:
2 edited

Legend:

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

    r36854 r37071  
    293293
    294294    function wp_die_handler( $message ) {
     295        if ( ! is_scalar( $message ) ) {
     296            $message = '0';
     297        }
     298
    295299        throw new WPDieException( $message );
    296300    }
  • trunk/tests/phpunit/tests/includes/helpers.php

    r36785 r37071  
    205205        return true;
    206206    }
     207
     208    /**
     209     * @ticket 36166
     210     * @expectedException WPDieException
     211     */
     212    public function test_die_handler_should_handle_wp_error() {
     213        wp_die( new WP_Error( 'test', 'test' ) );
     214    }
    207215}
Note: See TracChangeset for help on using the changeset viewer.