forked from boonebgorges/buddypress-group-email-subscription
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (37 loc) · 1.5 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
language: php
dist: trusty
matrix:
include:
- php: 7.2
- php: 7.3
env:
- WP_VERSION=latest WP_MULTISITE=0 BP_VERSION=master
- WP_VERSION=latest WP_MULTISITE=1 BP_VERSION=master
before_script:
- export WP_DEVELOP_DIR=/tmp/wordpress-develop/
- git clone git://develop.git.wordpress.org/trunk/ $WP_DEVELOP_DIR
- plugin_slug=$(basename $(pwd))
- plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
- cd ..
- mv $plugin_slug $plugin_dir
# set up BuddyPress
- buddypress_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/buddypress
- mkdir -p $buddypress_dir
- wget -nv -O /tmp/buddypress.tar.gz https://github.com/BuddyPress/BuddyPress/tarball/$BP_VERSION
- tar --strip-components=1 -zxmf /tmp/buddypress.tar.gz -C $buddypress_dir
# set up testing suite
- cd $WP_DEVELOP_DIR
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s:dirname( __FILE__ ) . '/wordpress/':'$WP_CORE_DIR':" wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
# prepare for running the tests
- cd $plugin_dir
- pwd
- composer install
script:
- vendor/bin/phpcs -p --standard=PHPCompatibilityWP --runtime-set testVersion 5.3- bp-activity-subscription* classes/ screen*.php templates/ lib/
- vendor/bin/phpunit