Ticket #11892: 11892.patch
File 11892.patch, 1.4 KB (added by , 15 years ago) |
---|
-
wordpress/wp-includes/functions.php
2485 2485 * @param string $title Error title. 2486 2486 * @param string|array $args Optional arguements to control behaviour. 2487 2487 */ 2488 function wp_die( $message , $title = '', $args = array() ) {2488 function wp_die( $message='', $title = '', $args = array() ) { 2489 2489 global $wp_locale; 2490 2490 2491 2491 $defaults = array( 'response' => 500 ); 2492 2492 $r = wp_parse_args($args, $defaults); 2493 2493 2494 do_action( 'wp_die_call', $message, $title, $r ); 2495 2494 2496 $have_gettext = function_exists('__'); 2495 2497 2496 2498 if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) { -
wp-test.php
73 73 // make sure we're installed 74 74 assert(true == is_blog_installed()); 75 75 76 // register exception on wp_die to make it test-able 77 add_action('wp_die_call', array('wp_die_exception', 'hook'), 1, 3); 78 class wp_die_exception extends Exception { 79 static function hook($message, $title, $args) { 80 throw new wp_die_exception(sprintf('Died. %s', print_r($message, true))); 81 } 82 } 83 76 84 // include plugins for testing, if any 77 85 if (is_dir(DIR_TESTPLUGINS)) { 78 86 $plugins = glob(realpath(DIR_TESTPLUGINS).'/*.php');