Skip to content
Browse files

Change all to TestAll and add a suite for testing just plugins.

Renamed all to TestAll because a lowercase classname is ugly.
  • Loading branch information...
1 parent 2e42960 commit 5de61eb250b12a788a6c6c232ed3b537121fa2b3 Gregory Cornelius committed Jun 8, 2012
Showing with 20 additions and 2 deletions.
  1. +3 −1 all.php → TestAll.php
  2. +17 −0 TestPlugins.php
  3. +0 −1 init.php
View
4 all.php → TestAll.php
@@ -1,6 +1,8 @@
<?php
require_once 'PHPUnit/Autoload.php';
+wp_test_load_plugin_tests();
+
$tests_dir = dirname( __FILE__ );
$old_cwd = getcwd();
chdir( $tests_dir );
@@ -11,7 +13,7 @@
}
}
-class all {
+class TestAll {
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite();
View
17 TestPlugins.php
@@ -0,0 +1,17 @@
+<?php
+require_once 'PHPUnit/Autoload.php';
+
+wp_test_load_plugin_tests();
+
+class TestPlugins {
+ public static function suite() {
+ $suite = new PHPUnit_Framework_TestSuite();
+
+ foreach( get_declared_classes() as $class ) {
+ if ( is_subclass_of( $class, 'WP_UnitTestCase' ) ) {
+ $suite->addTestSuite( $class );
+ }
+ }
+ return $suite;
+ }
+}
View
1 init.php
@@ -39,4 +39,3 @@
require WP_TESTS_PATH . '/lib/testcase.php';
require WP_TESTS_PATH . '/lib/exceptions.php';
-wp_test_load_plugin_tests();

0 comments on commit 5de61eb

Please sign in to comment.
Something went wrong with that request. Please try again.