10
10
- " 5.2"
11
11
sudo : false
12
12
env :
13
- - WP_VERSION=master WP_MULTISITE=0
13
+ - WP_VERSION=latest WP_MULTISITE=0
14
14
install :
15
15
- . $HOME/.nvm/nvm.sh
16
16
- nvm install stable
17
17
- nvm use stable
18
18
- npm install
19
19
- npm install grunt-cli -g
20
+ # # install PHPCS and Wordpress standards
21
+ - pear install pear/PHP_CodeSniffer
22
+ - mkdir $TRAVIS_BUILD_DIR/wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/master.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
23
+ - phpenv rehash
24
+ - phpcs --config-set installed_paths $TRAVIS_BUILD_DIR/wordpress-coding-standards
25
+ - phpenv rehash
20
26
before_script :
21
- # # Install the wordpress latest version
22
- - export WP_DEVELOP_DIR=/tmp/wordpress/
23
- - mkdir -p $WP_DEVELOP_DIR
24
- - git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
25
- - plugin_slug=$(basename $(pwd))
26
- - plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
27
- - cd ..
28
- - mv $plugin_slug $plugin_dir
29
- - cd $WP_DEVELOP_DIR
30
- - cp wp-tests-config-sample.php wp-tests-config.php
31
- - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
32
- - sed -i "s/yourusernamehere/root/" wp-tests-config.php
33
- - sed -i "s/yourpasswordhere//" wp-tests-config.php
34
- - mysql -e 'CREATE DATABASE wordpress_test;' -uroot
35
-
36
- # # install PHPCS and Wordpress standards
37
- - pear install pear/PHP_CodeSniffer
38
- - mkdir wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/master.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
39
- - phpenv rehash
40
- - phpcs --config-set installed_paths $WP_DEVELOP_DIR/wordpress-coding-standards
27
+ - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
28
+ - export PATH="$HOME/.composer/vendor/bin:$PATH"
29
+ - |
30
+ if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then
31
+ composer global require "phpunit/phpunit=5.7.*"
32
+ fi
41
33
- phpenv rehash
42
- - cd $plugin_dir
43
-
44
34
script :
45
35
grunt travis
0 commit comments