Make WordPress Core


Ignore:
Timestamp:
10/10/2014 08:25:39 PM (10 years ago)
Author:
boonebgorges
Message:

Only reset taxonomies and post types between tests when running core tests.

A growing number of plugins and other WP-based projects use the core test
tools, such as WP_UnitTestCase, as the basis of their own tests and continuous
integration setups. At the same time, many of these third-party plugins use
custom post types and taxonomies, which are generally registered a single time
during a run of the tests: at 'init', before the testcases have run. Wiping out
these globals between tests will mess with these third-party builds.

Best practice for plugin developers is probably to clean up their own post types
and taxonomies and then reinitialize before each test. But, in the interest of
not breaking everyone's builds, the core test suite will not enforce this.

Fixes #29827.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpunit.xml.dist

    r25165 r29869  
    2626        <log type="junit" target="tests/phpunit/build/logs/junit.xml" logIncompleteSkipped="false"/>
    2727    </logging>
     28    <php>
     29        <const name="WP_RUN_CORE_TESTS" value="1" />
     30    </php>
    2831</phpunit>
Note: See TracChangeset for help on using the changeset viewer.