Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 9ac856f

Browse files
authored
Merge pull request #31 from liquidweb/fix/woocommerce-test-suite-errors
Resolve WooCommerce test suite errors
2 parents 2fde693 + eba07de commit 9ac856f

17 files changed

+941
-859
lines changed

.travis.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
language: php
12
sudo: false
23
dist: trusty
34

4-
language: php
5-
65
notifications:
76
email: false
87

@@ -11,48 +10,34 @@ cache:
1110
- $HOME/.composer/cache
1211

1312
matrix:
13+
fast_finish: true
1414
include:
1515
- php: 7.2
16-
env: WP_VERSION=trunk
16+
env: WP_VERSION=trunk WP_MULTISITE=0 RUN_PHPCS=1
17+
- php: 7.2
18+
env: WP_VERSION=trunk WP_MULTISITE=1
1719
- php: 7.1
18-
env: WP_VERSION=latest
20+
env: WP_VERSION=latest WP_MULTISITE=0
1921
- php: 7.0
20-
env: WP_VERSION=latest
21-
- php: 5.6
22-
env: WP_VERSION=latest
23-
#- php: 5.6
24-
# env: WP_TRAVISCI=phpcs
25-
- php: 5.3
26-
env: WP_VERSION=latest
27-
dist: precise
22+
env: WP_VERSION=latest WP_MULTISITE=0
23+
24+
# The following WooCommerce core test currently fails in multisite, with or without this
25+
# plugin being active:
26+
#
27+
# WC_Tests_Setup_Functions::test_wizard_in_cart_payment_gateways()
28+
allow_failures:
29+
- php: 7.2
30+
env: WP_VERSION=trunk WP_MULTISITE=1
31+
2832

2933
before_script:
3034
- export PATH="$HOME/.composer/vendor/bin:$PATH"
31-
- |
32-
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
33-
phpenv config-rm xdebug.ini
34-
else
35-
echo "xdebug.ini does not exist"
36-
fi
37-
- |
38-
if [[ ! -z "$WP_VERSION" ]] ; then
39-
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
40-
composer global require "phpunit/phpunit=4.8.*|5.7.*"
41-
fi
42-
- |
43-
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
44-
composer global require wp-coding-standards/wpcs
45-
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
46-
fi
35+
- bash tests/bin/install-wp-tests.sh woocommerce_test root '' localhost $WP_VERSION
4736
- composer install --prefer-source
4837

4938
script:
39+
- phpunit
5040
- |
51-
if [[ ! -z "$WP_VERSION" ]] ; then
52-
phpunit
53-
WP_MULTISITE=1 phpunit
54-
fi
55-
- |
56-
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
57-
phpcs
41+
if [[ ${RUN_PHPCS} == 1 ]]; then
42+
./vendor/bin/phpcs
5843
fi

composer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
"xrstf/composer-php52": "^1.0"
1010
},
1111
"require-dev": {
12-
"woocommerce/woocommerce": "dev-master"
12+
"php": "^7.0",
13+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
14+
"wimg/php-compatibility": "^8.1",
15+
"woocommerce/woocommerce": "dev-master",
16+
"woocommerce/woocommerce-sniffs": "^0.0.1",
17+
"wp-coding-standards/wpcs": "^0.14"
1318
},
1419
"autoload": {
1520
"classmap": [
@@ -21,9 +26,6 @@
2126
"vendor/woocommerce/woocommerce/tests/framework"
2227
]
2328
},
24-
"autoload-dev": {
25-
"classmap": ["tests/test-tools"]
26-
},
2729
"scripts": {
2830
"post-install-cmd": [
2931
"xrstf\\Composer52\\Generator::onPostInstallCmd"
@@ -35,7 +37,7 @@
3537
"xrstf\\Composer52\\Generator::onPostInstallCmd"
3638
],
3739
"test-coverage": [
38-
"phpunit --coverage-html=tests/coverage"
40+
"phpunit --testsuite=plugin --coverage-html=tests/coverage"
3941
]
4042
},
4143
"extra": {

0 commit comments

Comments
 (0)