Making WordPress.org

Changeset 9999


Ignore:
Timestamp:
07/03/2020 02:53:29 AM (5 years ago)
Author:
coreymckrill
Message:

Plugin Directory: Update phpunit bootstrapper

This makes it compatible for running multiple test suites (different plugins)
across the entire wporg codebase.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/bootstrap.php

    r9923 r9999  
    11<?php
    22
    3 $_tests_dir = getenv( 'WP_TESTS_DIR' );
    4 if ( ! $_tests_dir ) {
    5     $_tests_dir = '/tmp/wordpress-tests-lib';
     3namespace WordPressdotorg\Plugin_Directory\Tests;
     4
     5if ( 'cli' !== php_sapi_name() ) {
     6    return;
    67}
    78
    8 require_once $_tests_dir . '/includes/functions.php';
    9 
    109/**
    11  * Load the plugin.
     10 * Manually load the plugin being tested.
    1211 */
    13 function _manually_load_plugin_directory_plugin() {
     12function manually_load_plugin() {
    1413    require_once dirname( __FILE__ ) . '/../plugin-directory.php';
    1514}
    1615
    17 tests_add_filter( 'muplugins_loaded', '_manually_load_plugin_directory_plugin' );
    18 
    19 require $_tests_dir . '/includes/bootstrap.php';
     16tests_add_filter( 'muplugins_loaded', __NAMESPACE__ . '\manually_load_plugin' );
Note: See TracChangeset for help on using the changeset viewer.