diff --git a/Gruntfile.js b/Gruntfile.js
index 01d6a143ae..bcfdd7523e 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -328,6 +328,10 @@ module.exports = function(grunt) {
multisite: {
cmd: 'phpunit',
args: ['-c', 'tests/phpunit/multisite.xml']
+ },
+ 'external-http': {
+ cmd: 'phpunit',
+ args: ['-c', 'phpunit.xml.dist', '--group', 'external-http']
}
},
uglify: {
@@ -482,7 +486,7 @@ module.exports = function(grunt) {
'uglify:core', 'uglify:jqueryui', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce', 'jsvalidate:build']);
// Testing tasks.
- grunt.registerMultiTask('phpunit', 'Runs PHPUnit tests, including the ajax and multisite tests.', function() {
+ grunt.registerMultiTask('phpunit', 'Runs PHPUnit tests, including the ajax, external-http, and multisite tests.', function() {
grunt.util.spawn({
cmd: this.data.cmd,
args: this.data.args,
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index abf5f00059..6f9dd226d8 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -20,6 +20,7 @@
ajax
+ external-http
diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php
index c70c6d65e7..575954bb52 100644
--- a/tests/phpunit/includes/bootstrap.php
+++ b/tests/phpunit/includes/bootstrap.php
@@ -128,13 +128,18 @@ class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt {
}
}
- $ajax_message = true;
- $ms_files_message = true;
+ $skipped_groups = array(
+ 'ajax' => true,
+ 'ms-files' => true,
+ 'external-http' => true,
+ );
+
foreach ( $options as $option ) {
switch ( $option[0] ) {
case '--exclude-group' :
- $ajax_message = false;
- $ms_files_message = false;
+ foreach ( $skipped_groups as $group_name => $skipped ) {
+ $skipped_groups[ $group_name ] = false;
+ }
continue 2;
case '--group' :
$groups = explode( ',', $option[1] );
@@ -143,16 +148,19 @@ class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt {
WP_UnitTestCase::forceTicket( $group );
}
}
- $ajax_message = ! in_array( 'ajax', $groups );
- $ms_files_message = ! in_array( 'ms-files', $groups );
+
+ foreach ( $skipped_groups as $group_name => $skipped ) {
+ if ( in_array( $group_name, $groups ) ) {
+ $skipped_groups[ $group_name ] = false;
+ }
+ }
continue 2;
}
}
- if ( $ajax_message ) {
- echo "Not running ajax tests... To execute these, use --group ajax." . PHP_EOL;
- }
- if ( $ms_files_message ) {
- echo "Not running ms_files_rewriting tests... To execute these, use --group ms-files." . PHP_EOL;
+
+ $skipped_groups = array_filter( $skipped_groups );
+ foreach ( $skipped_groups as $group_name => $skipped ) {
+ echo sprintf( 'Not running %1$s tests. To execute these, use --group %1$s.', $group_name ) . PHP_EOL;
}
}
}