Make WordPress Core


Ignore:
Timestamp:
02/27/2021 04:54:52 PM (4 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Fix and standardise calls to the setUp() and setUpBeforeClass() methods in the test suite.

The parent methods should always be called before any test-specific functionality is set up, unless there is a specific and documented reason.

See #52625

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/setupPostdata.php

    r48937 r50449  
    1111
    1212    protected $pages_global;
    13 
    14     public function setUp() {
    15         parent::setUp();
    16         return;
    17 
    18         foreach ( $this->global_keys as $global_key ) {
    19             if ( isset( $GLOBALS[ $global_key ] ) ) {
    20                 $this->global_data[ $global_key ] = $GLOBALS[ $global_key ];
    21                 unset( $GLOBALS[ $global_key ] );
    22             } else {
    23                 $this->global_data[ $global_key ] = null;
    24             }
    25         }
    26     }
    2713
    2814    public function test_id() {
Note: See TracChangeset for help on using the changeset viewer.