Commit 9e9d5c06 authored by Erick Hitter's avatar Erick Hitter

PHPCS

parent 4f9ab32b
Pipeline #1062 failed with stages
in 2 minutes and 42 seconds
......@@ -6,7 +6,6 @@
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
......
......@@ -5,34 +5,39 @@
* @package WP_Revisions_Control
*/
$_tests_dir = getenv( 'WP_TESTS_DIR' );
$wp_revisions_control_tests_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $_tests_dir ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
if ( ! $wp_revisions_control_tests_tests_dir ) {
$wp_revisions_control_tests_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; // WPCS: XSS ok.
if ( ! file_exists( $wp_revisions_control_tests_tests_dir . '/includes/functions.php' ) ) {
echo "Could not find $wp_revisions_control_tests_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; // WPCS: XSS ok.
exit( 1 );
}
// Give access to tests_add_filter() function.
require_once $_tests_dir . '/includes/functions.php';
require_once $wp_revisions_control_tests_tests_dir . '/includes/functions.php';
/**
* Stub admin-only function not needed for testing.
*/
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
if ( ! function_exists( 'post_revisions_meta_box' ) ) {
/**
* Stub for Core's revisions meta box.
*/
function post_revisions_meta_box() {}
}
// phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
/**
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
function wp_revisions_control_tests_manually_load_plugin() {
require dirname( dirname( __FILE__ ) ) . '/wp-revisions-control.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
// Start up the WP testing environment.
require $_tests_dir . '/includes/bootstrap.php';
require $wp_revisions_control_tests_tests_dir . '/includes/bootstrap.php';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment