Make WordPress Core


Ignore:
Timestamp:
03/05/2015 01:14:15 PM (10 years ago)
Author:
boonebgorges
Message:

In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods.

WP_UnitTestCase::tearDown() restores the test environment to the default
conditions, including rolling back the MySQL transaction that the test takes
place in, resetting globals, and unhooking test-specific filters. As such, all
teardown routines for specific tests should happen before the parent class's
tearDown() method is called. Failure to do so can cause database locks on
certain configurations, among other problems.

See #31537.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/widgets.php

    r31426 r31622  
    3636
    3737    function tearDown() {
    38         parent::tearDown();
    3938        $this->manager = null;
    4039        unset( $GLOBALS['wp_customize'] );
    4140        unset( $GLOBALS['wp_scripts'] );
     41        parent::tearDown();
    4242    }
    4343
Note: See TracChangeset for help on using the changeset viewer.