Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
Camo Image Proxy
Commits
3794862a
Commit
3794862a
authored
Aug 07, 2018
by
Erick Hitter
Browse files
Cleanup
parent
a13d5174
Pipeline
#115
passed with stage
in 20 minutes and 43 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
3794862a
...
...
@@ -3,6 +3,10 @@ variables:
MYSQL_DATABASE
:
wordpress_tests
MYSQL_ROOT_PASSWORD
:
mysql
cache
:
paths
:
-
$HOME/.composer
before_script
:
# Install dependencies
...
...
tests/bootstrap.php
View file @
3794862a
...
...
@@ -5,27 +5,27 @@
* @package Camo_Image_Proxy
*/
$_tests_dir
=
getenv
(
'WP_TESTS_DIR'
);
$
camo
_tests_dir
=
getenv
(
'WP_TESTS_DIR'
);
if
(
!
$_tests_dir
)
{
$_tests_dir
=
rtrim
(
sys_get_temp_dir
(),
'/\\'
)
.
'/wordpress-tests-lib'
;
if
(
!
$
camo
_tests_dir
)
{
$
camo
_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
;
if
(
!
file_exists
(
$
camo
_tests_dir
.
'/includes/functions.php'
)
)
{
echo
"Could not find
$
camo
_tests_dir
/includes/functions.php, have you run bin/install-wp-tests.sh ?"
.
PHP_EOL
;
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
exit
(
1
);
}
// Give access to tests_add_filter() function.
require_once
$_tests_dir
.
'/includes/functions.php'
;
require_once
$
camo
_tests_dir
.
'/includes/functions.php'
;
/**
* Manually load the plugin being tested.
*/
function
_manually_load_plugin
()
{
function
camo
_manually_load_plugin
()
{
require
dirname
(
dirname
(
__FILE__
)
)
.
'/camo-image-proxy.php'
;
}
tests_add_filter
(
'muplugins_loaded'
,
'_manually_load_plugin'
);
tests_add_filter
(
'muplugins_loaded'
,
'
camo
_manually_load_plugin'
);
// Start up the WP testing environment.
require
$_tests_dir
.
'/includes/bootstrap.php'
;
require
$
camo
_tests_dir
.
'/includes/bootstrap.php'
;
tests/test-sample.php
View file @
3794862a
...
...
@@ -13,7 +13,7 @@ class SampleTest extends WP_UnitTestCase {
/**
* A single example test.
*/
function
test_sample
()
{
public
function
test_sample
()
{
// Replace this with some actual testing code.
$this
->
assertTrue
(
true
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment