Skip to content

Commit 97b48b0

Browse files
authored
Merge branch 'development' into issue-40
2 parents 8c03477 + d6568c4 commit 97b48b0

File tree

19 files changed

+1090
-631
lines changed

19 files changed

+1090
-631
lines changed

.distignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ phpcs.xml
99
node_modules
1010
logs
1111
package.json
12+
bin
13+
tests
14+
phpunit.xml
1215
npm-debug.log

.travis.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,26 @@ php:
1010
- "5.2"
1111
sudo: false
1212
env:
13-
- WP_VERSION=master WP_MULTISITE=0
13+
- WP_VERSION=latest WP_MULTISITE=0
1414
install:
1515
- . $HOME/.nvm/nvm.sh
1616
- nvm install stable
1717
- nvm use stable
1818
- npm install
1919
- 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
2026
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
4133
- phpenv rehash
42-
- cd $plugin_dir
43-
4434
script:
4535
grunt travis

bin/install-wp-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

3+
34
if [ $# -lt 3 ]; then
45
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [force download]"
56
exit 1

0 commit comments

Comments
 (0)