Changeset 289 in tests
- Timestamp:
- 01/21/2010 10:41:47 PM (15 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-test.php
r288 r289 71 71 require_once(ABSPATH.'wp-settings.php'); 72 72 73 // Allow tests to override wp_die 74 add_filter( 'wp_die_handler', '_wp_die_handler_filter' ); 75 73 76 drop_tables(); 74 75 77 76 78 if (TEST_MU) -
wp-testcase/test_user_capabilities.php
r199 r289 122 122 // a role that doesn't exist 123 123 function test_bogus_role() { 124 _disable_wp_die(); 124 125 $id = $this->_make_user(rand_str()); 125 126 $user = new WP_User($id); … … 128 129 $this->assertEquals(array(), $user->roles); 129 130 $this->assertFalse($user->has_cap('level_0')); 131 _enable_wp_die(); 130 132 } 131 133 -
wp-testlib/base.php
r227 r289 25 25 restore_error_handler(); 26 26 } 27 _enable_wp_die(); 27 28 28 29 set_time_limit($this->_time_limit); … … 33 34 restore_error_handler(); 34 35 } 36 _enable_wp_die(); 35 37 } 36 38 -
wp-testlib/utils.php
r102 r289 302 302 } 303 303 304 $GLOBALS['_wp_die_disabled'] = false; 305 function _wp_die_handler( $message, $title = '', $args = array() ) { 306 if ( !$GLOBALS['_wp_die_disabled'] ) { 307 _default_wp_die_handler( $message, $title, $args ); 308 } else { 309 //Ignore at our peril 310 } 311 } 312 313 function _disable_wp_die() { 314 $GLOBALS['_wp_die_disabled'] = true; 315 } 316 317 function _enable_wp_die() { 318 $GLOBALS['_wp_die_disabled'] = false; 319 } 320 321 function _wp_die_handler_filter() { 322 return '_wp_die_handler'; 323 } 324 304 325 ?>
Note: See TracChangeset
for help on using the changeset viewer.