Skip to content

Commit bfb3902

Browse files
committed
Fix tests
1 parent 57fb181 commit bfb3902

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

.travis.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,23 @@ cache:
1818

1919
matrix:
2020
include:
21+
- php: 7.3
22+
env: WP_VERSION=latest
2123
- php: 7.2
2224
env: WP_VERSION=latest
2325
- php: 7.1
2426
env: WP_VERSION=latest
2527
- php: 7.0
2628
env: WP_VERSION=latest
27-
- php: 5.6
28-
env: WP_VERSION=latest
29-
- php: 5.6
29+
- php: 7.0
3030
env: WP_VERSION=trunk
31-
- php: 5.6
31+
- php: 7.0
3232
env: WP_TRAVISCI=phpcs
33+
dist: precise
3334

3435
before_script:
3536
- export PATH="$HOME/.composer/vendor/bin:$PATH"
37+
- composer install --ignore-platform-reqs --optimize-autoloader --no-interaction --prefer-dist
3638
- |
3739
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
3840
phpenv config-rm xdebug.ini
@@ -42,21 +44,15 @@ before_script:
4244
- |
4345
if [[ ! -z "$WP_VERSION" ]] ; then
4446
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
45-
composer global require "phpunit/phpunit=4.8.*|5.7.*"
46-
fi
47-
- |
48-
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
49-
composer global require wp-coding-standards/wpcs
50-
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
5147
fi
5248
5349
script:
5450
- |
5551
if [[ ! -z "$WP_VERSION" ]] ; then
56-
phpunit
57-
WP_MULTISITE=1 phpunit
52+
vendor/bin/phpunit
53+
WP_MULTISITE=1 vendor/bin/phpunit
5854
fi
5955
- |
6056
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
61-
phpcs
57+
vendor/bin/phpcs
6258
fi

composer.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,19 @@
99
"homepage": "http://wp-api.org/"
1010
}
1111
],
12+
"require": {
13+
"composer/installers": "~1.0",
14+
"php": "^5.6.0||^7.0"
15+
},
1216
"require-dev": {
13-
"humanmade/coding-standards": "dev-master"
17+
"squizlabs/php_codesniffer": "^3.3.1",
18+
"wp-coding-standards/wpcs": "^2.1.1",
19+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
20+
"phpcompatibility/phpcompatibility-wp": "^2.0",
21+
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0"
22+
},
23+
"scripts": {
24+
"post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs",
25+
"post-update-cmd" : "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs"
1426
}
1527
}

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Manually load the plugin being tested.
2424
*/
2525
function _manually_load_plugin() {
26-
require dirname( dirname( __FILE__ ) ) . '/oauth2.php';
26+
require dirname( dirname( __FILE__ ) ) . '/plugin.php';
2727
}
2828
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
2929

0 commit comments

Comments
 (0)