Changeset 1221 in tests
- Timestamp:
- 02/28/2013 04:30:21 PM (12 years ago)
- Location:
- trunk/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/exceptions.php
r903 r1221 6 6 7 7 /** 8 * Exception for cases of wp_die() 8 * General exception for wp_die() 9 */ 10 class WPDieException extends Exception {} 11 12 /** 13 * Exception for cases of wp_die(), for ajax tests. 9 14 * This means there was an error (no output, and a call to wp_die) 10 15 * … … 13 18 * @since 3.4.0 14 19 */ 15 class WPAjaxDieStopException extends Exception {}20 class WPAjaxDieStopException extends WPDieException {} 16 21 17 22 /** 18 * Exception for cases of wp_die() 23 * Exception for cases of wp_die(), for ajax tests. 19 24 * This means execution of the ajax function should be halted, but the unit 20 25 * test can continue. The function finished normally and there was not an … … 26 31 * @since 3.4.0 27 32 */ 28 class WPAjaxDieContinueException extends Exception {}33 class WPAjaxDieContinueException extends WPDieException {} -
trunk/includes/testcase.php
r1127 r1221 19 19 $this->clean_up_global_scope(); 20 20 $this->start_transaction(); 21 add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); 21 22 } 22 23 … … 26 27 remove_filter( 'dbdelta_create_queries', array( $this, '_create_temporary_tables' ) ); 27 28 remove_filter( 'query', array( $this, '_drop_temporary_tables' ) ); 29 remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); 28 30 } 29 31 … … 62 64 return 'DROP TEMPORARY TABLE ' . substr( $query, 10 ); 63 65 return $query; 66 } 67 68 function get_wp_die_handler( $handler ) { 69 return array( $this, 'wp_die_handler' ); 70 } 71 72 function wp_die_handler( $message ) { 73 throw new WPDieException( $message ); 64 74 } 65 75
Note: See TracChangeset
for help on using the changeset viewer.