Commit 3794862a authored by Erick Hitter's avatar Erick Hitter
Browse files

Cleanup

parent a13d5174
Pipeline #115 passed with stage
in 20 minutes and 43 seconds
...@@ -3,6 +3,10 @@ variables: ...@@ -3,6 +3,10 @@ variables:
MYSQL_DATABASE: wordpress_tests MYSQL_DATABASE: wordpress_tests
MYSQL_ROOT_PASSWORD: mysql MYSQL_ROOT_PASSWORD: mysql
cache:
paths:
- $HOME/.composer
before_script: before_script:
# Install dependencies # Install dependencies
......
...@@ -5,27 +5,27 @@ ...@@ -5,27 +5,27 @@
* @package Camo_Image_Proxy * @package Camo_Image_Proxy
*/ */
$_tests_dir = getenv( 'WP_TESTS_DIR' ); $camo_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $_tests_dir ) { if ( ! $camo_tests_dir ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib'; $camo_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
} }
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) { if ( ! file_exists( $camo_tests_dir . '/includes/functions.php' ) ) {
echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; 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 ); exit( 1 );
} }
// Give access to tests_add_filter() function. // 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. * Manually load the plugin being tested.
*/ */
function _manually_load_plugin() { function camo_manually_load_plugin() {
require dirname( dirname( __FILE__ ) ) . '/camo-image-proxy.php'; 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. // Start up the WP testing environment.
require $_tests_dir . '/includes/bootstrap.php'; require $camo_tests_dir . '/includes/bootstrap.php';
...@@ -13,7 +13,7 @@ class SampleTest extends WP_UnitTestCase { ...@@ -13,7 +13,7 @@ class SampleTest extends WP_UnitTestCase {
/** /**
* A single example test. * A single example test.
*/ */
function test_sample() { public function test_sample() {
// Replace this with some actual testing code. // Replace this with some actual testing code.
$this->assertTrue( true ); $this->assertTrue( true );
} }
......
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