Make WordPress Core

Changeset 25165


Ignore:
Timestamp:
08/29/2013 06:39:34 PM (11 years ago)
Author:
nacin
Message:

Move PHPUnit tests into a tests/phpunit directory.

wp-tests-config.php can/should reside in the root of a develop checkout. phpunit should be run from the root.

see #25088.

Location:
trunk
Files:
1 added
1 edited
9 moved

Legend:

Unmodified
Added
Removed
  • trunk/phpunit.xml.dist

    r25158 r25165  
    11<phpunit
    2     bootstrap="includes/bootstrap.php"
     2    bootstrap="tests/phpunit/includes/bootstrap.php"
    33        backupGlobals="false"
    44        colors="true"
     
    77        <!-- Default test suite to run all tests -->
    88        <testsuite>
    9             <directory suffix=".php">tests</directory>
    10             <exclude>tests/actions/closures.php</exclude>
    11             <exclude>tests/image/editor.php</exclude>
    12             <exclude>tests/image/editor_gd.php</exclude>
    13             <exclude>tests/image/editor_imagick.php</exclude>
    14             <file phpVersion="5.3.0">tests/actions/closures.php</file>
    15             <file phpVersion="5.3.0">tests/image/editor.php</file>
    16             <file phpVersion="5.3.0">tests/image/editor_gd.php</file>
    17             <file phpVersion="5.3.0">tests/image/editor_imagick.php</file>
     9            <directory suffix=".php">tests/phpunit/tests</directory>
     10            <exclude>tests/phpunit/tests/actions/closures.php</exclude>
     11            <exclude>tests/phpunit/tests/image/editor.php</exclude>
     12            <exclude>tests/phpunit/tests/image/editor_gd.php</exclude>
     13            <exclude>tests/phpunit/tests/image/editor_imagick.php</exclude>
     14            <file phpVersion="5.3.0">tests/phpunit/tests/actions/closures.php</file>
     15            <file phpVersion="5.3.0">tests/phpunit/tests/image/editor.php</file>
     16            <file phpVersion="5.3.0">tests/phpunit/tests/image/editor_gd.php</file>
     17            <file phpVersion="5.3.0">tests/phpunit/tests/image/editor_imagick.php</file>
    1818        </testsuite>
    1919    </testsuites>
     
    2424    </groups>
    2525    <logging>
    26         <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
     26        <log type="junit" target="tests/phpunit/build/logs/junit.xml" logIncompleteSkipped="false"/>
    2727    </logging>
    2828</phpunit>
  • trunk/tests/phpunit/includes/bootstrap.php

    r25145 r25165  
    55
    66
    7 $config_file_path = dirname( __FILE__ ) . '/../wp-tests-config.php';
    8 if ( ! file_exists( $config_file_path ) ) {
    9     // Support having the config file one level up.
    10     $config_file_path = dirname( __FILE__ ) . '/../../wp-tests-config.php';
     7$config_file_path = dirname( dirname( __FILE__ ) );
     8if ( ! file_exists( $config_file_path . '/wp-tests-config.php' ) ) {
     9    // Support the config file from the root of the develop repository.
     10    if ( basename( $config_file_path ) === 'phpunit' && basename( dirname( $config_file_path ) ) === 'tests' )
     11        $config_file_path = dirname( dirname( $config_file_path ) );
    1112}
     13$config_file_path .= '/wp-tests-config.php';
    1214
    1315/*
    1416 * Globalize some WordPress variables, because PHPUnit loads this file inside a function
    1517 * See: https://github.com/sebastianbergmann/phpunit/issues/325
    16  *
    17  * These are not needed for WordPress 3.3+, only for older versions
    18 */
    19 global $table_prefix, $wp_embed, $wp_locale, $_wp_deprecated_widgets_callbacks, $wp_widget_factory;
    20 
    21 // These are still needed
     18 */
    2219global $wpdb, $current_site, $current_blog, $wp_rewrite, $shortcode_tags, $wp, $phpmailer;
    2320
  • trunk/wp-tests-config-sample.php

    r25158 r25165  
    22
    33/* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
    4 define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/src/' );
     4define( 'ABSPATH', dirname( __FILE__ ) . '/src/' );
    55
    66// Test with multisite enabled: (previously -m)
Note: See TracChangeset for help on using the changeset viewer.