-
Notifications
You must be signed in to change notification settings - Fork 24
/
.travis.yml
43 lines (36 loc) · 1.41 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Travis CI Configuration File
# Tell Travis CI we're using PHP
language: php
# PHP version used in first build configuration.
php:
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- "7.0"
# WordPress version used in first build configuration.
env:
- WP_VERSION=master
- WP_VERSION=4.6
# Clones WordPress and configures our testing environment.
before_script:
- export REPO_SLUG=$(basename $(pwd))
- export PLUGIN_SLUG=wpclef
# fix sendmail
- chmod +x tests/setup/fakesendmail.sh
- sudo mkdir -p /var/qmail/bin
- sudo cp tests/setup/fakesendmail.sh /var/qmail/bin/sendmail
- sudo cp tests/setup/fakesendmail.sh /usr/sbin/sendmail
- echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' | sudo tee "/home/travis/.phpenv/versions/`php -r 'echo PHP_VERSION;'`/etc/conf.d/sendmail.ini"
# clone wordpress
- git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
- cd ..
- mv "$REPO_SLUG" "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
- cd /tmp/wordpress
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
- sed -i "s/yourusernamehere/travis/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
- cd "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
script: phpunit