Making WordPress.org

Changeset 4601


Ignore:
Timestamp:
12/30/2016 07:18:35 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Remote CSS: Remove unneeded dependencies from test bootstrap

Jetpack 4.4.2 modularized the sanitization function, so we no longer need to include all of Jetpack, making this more of a pure unit test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-remote-css/tests/bootstrap.php

    r2960 r4601  
    1717
    1818require_once( $core_tests_directory . '/includes/functions.php' );
     19require_once( dirname( dirname( $core_tests_directory ) ) . '/src/wp-admin/includes/plugin.php' );
    1920
    2021/**
     
    2728     * Defining WP_ADMIN is so that wordcamp-remote-css/bootstrap.php will load the app/*.php files.
    2829     * It may need to be refactored if we add tests for output-cached-css.php.
    29      * We shouldn't really be using PHPUnit for functional tests, though, so it'd be better to switch those tests
    30      * to Codeception or Behat.
    3130     */
    3231    define( 'WP_ADMIN',          true );
    3332    define( 'JETPACK_DEV_DEBUG', true );
     33    define( 'JETPACK__PLUGIN_DIR', dirname( dirname( __DIR__ ) ) . '/jetpack' );
     34
     35    $jetpack_plugin_data = get_plugin_data( JETPACK__PLUGIN_DIR . '/jetpack.php', false );
     36
     37    define( 'JETPACK__VERSION', $jetpack_plugin_data['Version'] );
    3438
    3539    require_once( dirname(          __DIR__ )   . '/bootstrap.php'       );
    36     require_once( dirname( dirname( __DIR__ ) ) . '/jetpack/jetpack.php' );
     40    require_once( JETPACK__PLUGIN_DIR . '/modules/custom-css/custom-css-4.7.php' );
    3741
    3842    // Some of the sanitization lives here because it runs for both Custom CSS and Remote CSS
     
    4246
    4347require( $core_tests_directory . '/includes/bootstrap.php' );
    44 
    45 \Jetpack::activate_module( 'custom-css', false, false );
Note: See TracChangeset for help on using the changeset viewer.