File tree Expand file tree Collapse file tree 3 files changed +25
-15
lines changed Expand file tree Collapse file tree 3 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,23 @@ sudo: false
4
4
5
5
# Test main supported versions of PHP and HHVM against latest WP. 5.2 is min supported version.
6
6
php :
7
- - 5.6
8
7
- 7.0
9
8
- 7.1
10
9
10
+ services :
11
+ - mysql
12
+
11
13
env :
12
14
- WP_VERSION=latest WP_MULTISITE=0
13
15
14
16
before_script :
15
17
- export PATH="$HOME/.composer/vendor/bin:$PATH"
16
18
- phpenv config-rm xdebug.ini
19
+ - composer install
17
20
- bash tests/bin/install-phpunit-tests-dependencies.sh wc_apa_test root '' localhost $WP_VERSION
18
21
19
- script : phpunit -c phpunit.xml
22
+ script : ./vendor/bin/phpunit -c phpunit.xml
23
+
24
+ branches :
25
+ only :
26
+ - main
Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ DB_PASS=$3
12
12
DB_HOST=${4-localhost}
13
13
WP_VERSION=${5-latest}
14
14
15
- WP_TESTS_DIR=${WP_TESTS_DIR-/ tmp/ wordpress-tests-lib}
16
- WP_CORE_DIR=${WP_CORE_DIR-/ tmp/ wordpress/ }
15
+ TMPDIR=${TMPDIR-/ tmp}
16
+ TMPDIR=$( echo $TMPDIR | sed -e " s/\/$//" )
17
+ WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR / wordpress-tests-lib}
18
+ WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR / wordpress/ }
17
19
18
20
download () {
19
21
if [ ` which curl` ]; then
@@ -60,12 +62,13 @@ install_wp() {
60
62
}
61
63
62
64
install_woocommerce () {
63
- cd $TRAVIS_BUILD_DIR
64
- cd ..
65
- download https://codeload.github.com/woocommerce/woocommerce/tar.gz/3.2.5 woocommerce.tar.gz
66
- mkdir woocommerce
67
- tar --strip-components=1 -zxmf woocommerce.tar.gz -C woocommerce
68
- cd -
65
+ cd $TRAVIS_BUILD_DIR
66
+ cd ..
67
+
68
+ git clone --depth=1 --branch 4.3.1 https://github.com/woocommerce/woocommerce.git
69
+ cd woocommerce
70
+ composer install
71
+ cd -
69
72
}
70
73
71
74
install_test_suite () {
Original file line number Diff line number Diff line change 1
1
<?php
2
2
$ _tests_dir = getenv ( 'WP_TESTS_DIR ' );
3
3
if ( ! $ _tests_dir ) {
4
- $ _tests_dir = ' /tmp /wordpress-tests-lib ' ;
4
+ $ _tests_dir = sys_get_temp_dir () . ' /wordpress-tests-lib ' ;
5
5
}
6
6
7
7
require_once $ _tests_dir . '/includes/functions.php ' ;
8
8
9
9
function _manually_load_plugin () {
10
- $ plugins_dir = dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) );
11
- require $ plugins_dir . '/woocommerce-gateway-amazon-payments-advanced /woocommerce-gateway-amazon-payments-advanced.php ' ;
12
- require $ plugins_dir . '/woocommerce/woocommerce.php ' ;
10
+ $ base_dir = dirname ( dirname ( dirname ( __FILE__ ) ) );
11
+ require $ base_dir . '/woocommerce-gateway-amazon-payments-advanced.php ' ;
12
+ require $ base_dir . '/.. /woocommerce/woocommerce.php ' ;
13
13
}
14
14
tests_add_filter ( 'muplugins_loaded ' , '_manually_load_plugin ' );
15
15
@@ -43,4 +43,4 @@ function _manually_load_plugin() {
43
43
44
44
// Require the WooCommerce tests bootstrap so that we can use WooCommerce's testing resources as well.
45
45
$ plugins_dir = dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) );
46
- require_once $ plugins_dir . '/woocommerce/tests/bootstrap.php ' ;
46
+ require_once $ plugins_dir . '/woocommerce/tests/legacy/ bootstrap.php ' ;
You can’t perform that action at this time.
0 commit comments