-
Notifications
You must be signed in to change notification settings - Fork 2
/
.magnum.yml
42 lines (38 loc) · 1.54 KB
/
.magnum.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
# Specify versions of WordPress to test against
# WP_VERSION = WordPress version number (use "master" for SVN trunk)
# WP_MULTISITE = whether to test multisite (use either "0" or "1")
env:
- WP_VERSION=master WP_MULTISITE=0
# Grab the setup script and execute
before_script:
# set up WP install
- WP_CORE_DIR=/tmp/wordpress/
- mkdir -p $WP_CORE_DIR
- wget -nv -O /tmp/wordpress.tar.gz https://github.com/WordPress/WordPress/tarball/$WP_VERSION
- tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
# set up testing suite
- export WP_TESTS_DIR=/tmp/wordpress-tests/
- svn co --ignore-externals --quiet http://unit-tests.svn.wordpress.org/trunk/ $WP_TESTS_DIR
- cd $WP_TESTS_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/yourdbnamehere/wordpress_test/" wp-tests-config.php
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
- cd -
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
- plugin_slug=$(basename $(pwd))
- plugin_dir=$WP_CORE_DIR/wp-content/plugins/$plugin_slug
# move plugin into place
- cd ..
- mv $plugin_slug $plugin_dir
- cd $plugin_dir # - wget https://raw.github.com/benbalter/wordpress-plugin-tests/setup/setup.sh
# - source setup.sh
# - cd ..
script: phpunit
# wordpress-plugin-tests specific config
# Tells Travis CI not to run unit tests against the setup branch
branches:
except:
- setup