Skip to content

Commit aeeed2d

Browse files
committed
added phpunit
1 parent eadb7d7 commit aeeed2d

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

.travis.yml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,21 @@ 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
4128
- phpenv rehash
42-
- cd $plugin_dir
43-
4429
script:
4530
grunt travis

0 commit comments

Comments
 (0)