diff --git a/plugins/woocommerce-admin/bin/travis.sh b/plugins/woocommerce-admin/bin/travis.sh index c4f9f1076c1..ebe11425410 100755 --- a/plugins/woocommerce-admin/bin/travis.sh +++ b/plugins/woocommerce-admin/bin/travis.sh @@ -3,10 +3,10 @@ if [ $1 == 'before' ]; then cd "$WP_CORE_DIR/wp-content/plugins/woocommerce-admin/" + npm run build:feature-config if [[ ${RUN_PHPCS} == 1 ]]; then composer install else - npm run build:feature-config composer install --no-dev fi diff --git a/plugins/woocommerce-admin/includes/core-functions.php b/plugins/woocommerce-admin/includes/core-functions.php index 72edb9d508f..2471d097f21 100644 --- a/plugins/woocommerce-admin/includes/core-functions.php +++ b/plugins/woocommerce-admin/includes/core-functions.php @@ -7,8 +7,6 @@ * @package WC_Admin\Functions */ -defined( 'ABSPATH' ) || exit; - use \Automattic\WooCommerce\Admin\Loader; /** diff --git a/plugins/woocommerce-admin/tests/api/reports-downloads.php b/plugins/woocommerce-admin/tests/api/reports-downloads.php index 07104ee31b4..830868c97f8 100644 --- a/plugins/woocommerce-admin/tests/api/reports-downloads.php +++ b/plugins/woocommerce-admin/tests/api/reports-downloads.php @@ -92,7 +92,7 @@ class WC_Tests_API_Reports_Downloads extends WC_REST_Unit_Test_Case { $this->assertEquals( $this->user, $download_report['user_id'] ); $this->assertEquals( '1.2.3.4', $download_report['ip_address'] ); $this->assertEquals( 'help.png', $download_report['file_name'] ); - $this->assertEquals( plugin_dir_url( __FILE__ ) . 'assets/images/help.png', $download_report['file_path'] ); + $this->assertEquals( esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/help.png' ), $download_report['file_path'] ); } /** @@ -170,7 +170,7 @@ class WC_Tests_API_Reports_Downloads extends WC_REST_Unit_Test_Case { $id = $object->save(); WC_Helper_Queue::run_all_pending(); - + return array( 'time' => $time, 'product_1' => $product_1, diff --git a/plugins/woocommerce-admin/tests/bootstrap.php b/plugins/woocommerce-admin/tests/bootstrap.php index 5624bbb8910..27227bd157e 100755 --- a/plugins/woocommerce-admin/tests/bootstrap.php +++ b/plugins/woocommerce-admin/tests/bootstrap.php @@ -111,10 +111,9 @@ require_once dirname( __FILE__ ) . '/framework/helpers/class-wc-test-action-queu require_once dirname( __FILE__ ) . '/framework/helpers/class-wc-helper-queue.php'; /** - * Set the environment and feature flags to 'develop' when running tests, instead of what is set in the generated `config/feature-flags.php`. - * This matches how we mock the flags in jest. + * Use the `development` features for testing. */ -function wc_admin_get_feature_config() { +function wc_admin_add_development_features() { $config = json_decode( file_get_contents( dirname( dirname( __FILE__ ) ) . '/config/development.json' ) ); // @codingStandardsIgnoreLine. $flags = array(); foreach ( $config->features as $feature => $bool ) { @@ -122,3 +121,4 @@ function wc_admin_get_feature_config() { } return $flags; } +tests_add_filter( 'wc_admin_get_feature_config', 'wc_admin_add_development_features' );