diff --git a/.travis.yml b/.travis.yml index 0d1c5f80e..046bc51de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,23 @@ language: php php: - - 5.3 - - 5.4 + - 5.3 + - 5.4 env: - - WP_VERSION=latest WP_MULTISITE=0 - - WP_VERSION=latest WP_MULTISITE=1 - - WP_VERSION=3.8 WP_MULTISITE=0 - - WP_VERSION=3.8 WP_MULTISITE=1 - - WP_VERSION=3.5 WP_MULTISITE=0 - - WP_VERSION=3.5 WP_MULTISITE=1 + - WP_VERSION=latest WP_MULTISITE=0 + - WP_VERSION=latest WP_MULTISITE=1 + - WP_VERSION=3.8 WP_MULTISITE=0 + - WP_VERSION=3.8 WP_MULTISITE=1 + - WP_VERSION=3.5 WP_MULTISITE=0 + - WP_VERSION=3.5 WP_MULTISITE=1 before_script: - - bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION + - bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION script: phpunit branches: - only: - - master - - trunk + only: + - master + - trunk diff --git a/phpunit.xml b/phpunit.xml index 1160f0cab..e2c550789 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,18 +1,15 @@ - - - - ./tests/phpunit/tests + + ./tests/ diff --git a/tests/README.md b/tests/README.md index 3d80ad942..65d95f2d0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -26,8 +26,13 @@ If you haven't already installed the WordPress testing library, we have a helpfu Note: you'll need to already have `svn`, `wget`, and `mysql` available. +Change to the CMB directory: ```bash -./tests/bin/install-wp-tests.sh wordpress_test root '' localhost latest +cd Custom-Metaboxes-and-Fields-for-WordPress +``` + +```bash +bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost latest ``` * `wordpress_test` is the name of the test database (**all data will be deleted!**) * `root` is the MySQL user name diff --git a/tests/bin/install-wp-tests.sh b/tests/bin/install-wp-tests.sh index 2e924248b..1e39064a5 100644 --- a/tests/bin/install-wp-tests.sh +++ b/tests/bin/install-wp-tests.sh @@ -19,7 +19,7 @@ set -ex install_wp() { mkdir -p $WP_CORE_DIR - if [ $WP_VERSION == 'latest' ]; then + if [ $WP_VERSION == 'latest' ]; then local ARCHIVE_NAME='latest' else local ARCHIVE_NAME="wordpress-$WP_VERSION" diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 000000000..3e45d9131 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,14 @@ + array( - 'hello.php', - ), -); - -/** - * Run custom functionality after mu-plugins are loaded. - */ -function _tests_load_badgeos() { - define( 'CMB_DIRECTORY_PATH', trailingslashit( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) ); - require CMB_DIRECTORY_PATH . 'init.php'; -} -tests_add_filter( 'muplugins_loaded', '_tests_load_badgeos' ); - -/** - * Bootstraps the WordPress stack. - */ -require $wp_test_dir . '/includes/bootstrap.php'; diff --git a/tests/phpunit/tests/CMB_Core_Test.php b/tests/test-cmb-core.php similarity index 100% rename from tests/phpunit/tests/CMB_Core_Test.php rename to tests/test-cmb-core.php