Skip to content

Commit

Permalink
Update testing suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Jun 18, 2014
1 parent 8b16fed commit 22a5ed5
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 82 deletions.
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap = "tests/phpunit/includes/bootstrap.php"
bootstrap = "tests/bootstrap.php"
backupGlobals = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
syntaxCheck = "false"
verbose = "true"
>
<testsuites>
<!-- Default test suite to run all tests -->
<testsuite name="BadgeOS Test Suite">
<directory suffix=".php">./tests/phpunit/tests</directory>
<testsuite>
<directory prefix="test-" suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
7 changes: 6 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/bin/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 14 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$_tests_dir = getenv('WP_TESTS_DIR');
if ( !$_tests_dir ) $_tests_dir = '/tmp/wordpress-tests-lib';

require_once $_tests_dir . '/includes/functions.php';

function _manually_load_plugin() {
require dirname( __FILE__ ) . '/../init.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );

require $_tests_dir . '/includes/bootstrap.php';

62 changes: 0 additions & 62 deletions tests/phpunit/includes/bootstrap.php

This file was deleted.

File renamed without changes.

0 comments on commit 22a5ed5

Please sign in to comment.