Skip to content

Commit 3b79fc8

Browse files
authored
Merge pull request #1180 from xwp/tests/mercator-connector
Mercator connector test implemented
2 parents 687222a + ef868bb commit 3b79fc8

9 files changed

+281
-23
lines changed

composer.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
"composer/installers": "~1.0"
1515
},
1616
"require-dev": {
17-
"johnpbloch/wordpress": "^5.4",
1817
"automattic/vipwpcs": "^2.0.0",
18+
"humanmade/mercator": "^1.0",
19+
"johnpbloch/wordpress": "^5.4",
1920
"php-coveralls/php-coveralls": "^2.1",
2021
"phpunit/phpunit": "^5.7",
2122
"wp-cli/wp-cli-bundle": "^2.2",
2223
"wp-coding-standards/wpcs": "^2.2",
2324
"wp-phpunit/wp-phpunit": "^5.4",
24-
"wpsh/local": "^0.2.3",
2525
"wpackagist-plugin/advanced-custom-fields": "5.8.12",
2626
"wpackagist-plugin/easy-digital-downloads": "^2.9.23",
27-
"wpackagist-plugin/user-switching": "^1.5.5"
27+
"wpackagist-plugin/user-switching": "^1.5.5",
28+
"wpsh/local": "^0.2.3"
2829
},
2930
"config": {
3031
"process-timeout": 600,
@@ -36,7 +37,8 @@
3637
"extra": {
3738
"wordpress-install-dir": "local/public",
3839
"installer-paths": {
39-
"local/public/wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
40+
"local/public/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
41+
"local/public/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"]
4042
}
4143
},
4244
"scripts": {

composer.lock

+41-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ services:
3131
- ./local/config/wp-cli.yml:/var/www/html/wp-cli.yml
3232
- ./local/config/wp-config.php:/var/www/html/wp-config.php
3333
- ./local/config/wp-tests-config.php:/var/www/html/wp-tests-config.php
34+
- ./local/config/sunrise.php:/var/www/html/wp-content/sunrise.php
3435
restart: always
3536
environment:
3637
COMPOSER_HOME: /tmp/.composer

local/config/sunrise.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
// Default mu-plugins directory if you haven't set it
3+
defined( 'WPMU_PLUGIN_DIR' ) or define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' );
4+
5+
require WPMU_PLUGIN_DIR . '/mercator/mercator.php';

local/config/wp-config.php

+3
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@
2727

2828
define( 'ABSPATH', __DIR__ . '/' );
2929

30+
// For mercator.
31+
define( 'SUNRISE', true );
32+
3033
require_once ABSPATH . 'wp-settings.php';

package-lock.json

+8-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"grunt-wp-deploy": "^2.1.2"
3737
},
3838
"scripts": {
39-
"postinstall": "composer install && npm run build",
39+
"postinstall": "composer install --no-autoloader && composer dumpautoload -o && composer install && npm run build",
4040
"build": "grunt build",
4141
"release": "grunt release",
4242
"deploy": "grunt deploy",

tests/bootstrap.php

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ function() {
4646
require dirname( __DIR__ ) . '/stream.php';
4747
}
4848
);
49+
function xwp_manually_load_mercator() {
50+
define( 'MERCATOR_SKIP_CHECKS', true );
51+
require WPMU_PLUGIN_DIR . '/mercator/mercator.php';
52+
}
53+
54+
tests_add_filter( 'muplugins_loaded', 'xwp_manually_load_mercator' );
4955

5056
// @see https://core.trac.wordpress.org/browser/trunk/tests/phpunit/includes/bootstrap.php
5157
require $_tests_dir . '/includes/bootstrap.php';

0 commit comments

Comments
 (0)