WordPress.org

Make WordPress Core

Ticket #29827: 29827.4.patch

File 29827.4.patch, 1.1 KB (added by boonebgorges, 6 years ago)
  • phpunit.xml.dist

    diff --git phpunit.xml.dist phpunit.xml.dist
    index 2178ce2..abf5f00 100644
     
    2525    <logging>
    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>
  • tests/phpunit/includes/testcase.php

    diff --git tests/phpunit/includes/testcase.php tests/phpunit/includes/testcase.php
    index 4230164..79a29a2 100644
    class WP_UnitTestCase extends PHPUnit_Framework_TestCase { 
    3737                ini_set('display_errors', 1 );
    3838                $this->factory = new WP_UnitTest_Factory;
    3939                $this->clean_up_global_scope();
    40                 $this->reset_post_types();
    41                 $this->reset_taxonomies();
     40
     41                if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
     42                        $this->reset_post_types();
     43                        $this->reset_taxonomies();
     44                }
     45
    4246                $this->start_transaction();
    4347                $this->expectDeprecated();
    4448                add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) );