Changeset 61589
- Timestamp:
- 02/04/2026 09:05:25 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/abstract-testcase.php
r61459 r61589 59 59 /** 60 60 * Runs the routine before setting up all tests. 61 * 62 * @global wpdb $wpdb WordPress database abstraction object. 61 63 */ 62 64 public static function set_up_before_class() { … … 99 101 /** 100 102 * Runs the routine before each test is executed. 103 * 104 * @global WP_Rewrite $wp_rewrite WordPress rewrite rules object. 101 105 */ 102 106 public function set_up() { 107 global $wp_rewrite; 108 103 109 set_time_limit( 0 ); 104 110 … … 112 118 $this->_backup_hooks(); 113 119 } 114 115 global $wp_rewrite;116 120 117 121 $this->clean_up_global_scope(); … … 156 160 /** 157 161 * After a test method runs, resets any state in WordPress the test method might have changed. 162 * 163 * @global wpdb $wpdb WordPress database abstraction object. 164 * @global WP_Query $wp_the_query WordPress Query object. 165 * @global WP_Query $wp_query WordPress Query object. 166 * @global WP $wp WordPress environment object. 158 167 */ 159 168 public function tear_down() { 160 169 global $wpdb, $wp_the_query, $wp_query, $wp; 170 161 171 $wpdb->query( 'ROLLBACK' ); 172 162 173 if ( is_multisite() ) { 163 174 while ( ms_is_switched() ) { … … 360 371 * on a class variable so they can be restored on tear_down() using _restore_hooks(). 361 372 * 362 * @global array $wp_filter 363 * @global array $wp_actions 364 * @global array $wp_filters 365 * @global array $wp_current_filter 373 * @global array $wp_filter Stores all of the filters and actions. 374 * @global array $wp_actions Stores the number of times each action was triggered. 375 * @global array $wp_filters Stores the number of times each filter was triggered. 376 * @global array $wp_current_filter Stores the list of current filters with the current one last. 366 377 */ 367 378 protected function _backup_hooks() { … … 383 394 * so that future tests aren't affected by hooks set during this last test. 384 395 * 385 * @global array $wp_filter 386 * @global array $wp_actions 387 * @global array $wp_filters 388 * @global array $wp_current_filter 396 * @global array $wp_filter Stores all of the filters and actions. 397 * @global array $wp_actions Stores the number of times each action was triggered. 398 * @global array $wp_filters Stores the number of times each filter was triggered. 399 * @global array $wp_current_filter Stores the list of current filters with the current one last. 389 400 */ 390 401 protected function _restore_hooks() { … … 408 419 /** 409 420 * Flushes the WordPress object cache. 421 * 422 * @global WP_Object_Cache $wp_object_cache WordPress Object Cache object. 410 423 */ 411 424 public static function flush_cache() { … … 453 466 * @since 5.1.0 454 467 * 455 * @global array $wp_meta_keys 468 * @global array $wp_meta_keys Global registry for meta keys. 456 469 */ 457 470 public function unregister_all_meta_keys() { 458 471 global $wp_meta_keys; 472 459 473 if ( ! is_array( $wp_meta_keys ) ) { 460 474 return; 461 475 } 476 462 477 foreach ( $wp_meta_keys as $object_type => $type_keys ) { 463 478 foreach ( $type_keys as $object_subtype => $subtype_keys ) { … … 471 486 /** 472 487 * Starts a database transaction. 488 * 489 * @global wpdb $wpdb WordPress database abstraction object. 473 490 */ 474 491 public function start_transaction() { 475 492 global $wpdb; 493 476 494 $wpdb->query( 'SET autocommit = 0;' ); 477 495 $wpdb->query( 'START TRANSACTION;' ); 496 478 497 add_filter( 'query', array( $this, '_create_temporary_tables' ) ); 479 498 add_filter( 'query', array( $this, '_drop_temporary_tables' ) ); … … 484 503 * 485 504 * @since 4.1.0 505 * 506 * @global wpdb $wpdb WordPress database abstraction object. 486 507 */ 487 508 public static function commit_transaction() { 488 509 global $wpdb; 510 489 511 $wpdb->query( 'COMMIT;' ); 490 512 } … … 1133 1155 * @since 5.3.0 Formalized the existing `...$prop` parameter by adding it 1134 1156 * to the function signature. 1157 * 1158 * @global WP_Query $wp_query WordPress Query object. 1135 1159 * 1136 1160 * @param string ...$prop Any number of WP_Query properties that are expected to be true for the current request. … … 1633 1657 * @since 4.4.0 1634 1658 * 1635 * @global WP_Rewrite $wp_rewrite 1659 * @global WP_Rewrite $wp_rewrite WordPress rewrite rules object. 1636 1660 * 1637 1661 * @param string $structure Optional. Permalink structure to set. Default empty.
Note: See TracChangeset
for help on using the changeset viewer.