Skip to content
Snippets Groups Projects
Commit 3794862a authored by Erick Hitter's avatar Erick Hitter
Browse files

Cleanup

parent a13d5174
No related branches found
No related tags found
1 merge request!1Add GitLab CI
Pipeline #115 passed with warnings
......@@ -3,6 +3,10 @@ variables:
MYSQL_DATABASE: wordpress_tests
MYSQL_ROOT_PASSWORD: mysql
cache:
paths:
- $HOME/.composer
before_script:
# Install dependencies
......
......@@ -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';
......@@ -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 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment