Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
WP Revisions Control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WP Plugins
WP Revisions Control
Merge requests
!4
Add bulk actions
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add bulk actions
add/1-bulk-action
into
master
Overview
0
Commits
15
Pipelines
8
Changes
4
Merged
Erick Hitter
requested to merge
add/1-bulk-action
into
master
6 years ago
Overview
0
Commits
15
Pipelines
8
Changes
4
Expand
Fixes
#1 (closed)
Edited
6 years ago
by
Erick Hitter
0
0
Merge request reports
Viewing commit
9e9d5c06
Prev
Next
Show latest version
4 files
+
17
−
13
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
9e9d5c06
PHPCS
· 9e9d5c06
Erick Hitter
authored
6 years ago
tests/bootstrap.php
+
13
−
8
Options
@@ -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'
;
Loading