mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-26 10:01:44 +08:00
32 lines
No EOL
830 B
PHP
Executable file
32 lines
No EOL
830 B
PHP
Executable file
<?php
|
|
$_tests_dir = getenv( 'WP_TESTS_DIR' );
|
|
if ( ! $_tests_dir )
|
|
$_tests_dir = '/tmp/wordpress-tests-lib';
|
|
|
|
/**
|
|
* change PLUGIN_FILE env in phpunit.xml
|
|
*/
|
|
define( 'PLUGIN_FILE', getenv( 'PLUGIN_FILE' ) );
|
|
define( 'PLUGIN_FOLDER', basename( dirname( __DIR__ ) ) );
|
|
define( 'PLUGIN_PATH', PLUGIN_FOLDER . '/' . PLUGIN_FILE );
|
|
|
|
// Activates this plugin in WordPress so it can be tested.
|
|
$GLOBALS['wp_tests_options'] = array(
|
|
'active_plugins' => array( PLUGIN_PATH ),
|
|
);
|
|
|
|
require_once $_tests_dir . '/includes/functions.php';
|
|
|
|
tests_add_filter(
|
|
'muplugins_loaded',
|
|
function() {
|
|
// Manually load plugin
|
|
require dirname( __DIR__ ) . '/' . PLUGIN_FILE;
|
|
}
|
|
);
|
|
|
|
// Removes all sql tables on shutdown
|
|
// Do this action last
|
|
tests_add_filter( 'shutdown', 'drop_tables', 999999 );
|
|
|
|
require $_tests_dir . '/includes/bootstrap.php'; |