Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use is_subclass_of() to find tests.

  • Loading branch information...
commit df94b1c69c4aabe4a6a33d5d6dbc34d80ed59824 1 parent 762b5b2
Gregory Cornelius authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 all.php
5 all.php
View
@@ -14,8 +14,9 @@
class all {
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite();
+
foreach( get_declared_classes() as $class ) {
- if ( preg_match( '/^WP_Test_/', $class ) ) {
+ if ( is_subclass_of( $class, 'WP_UnitTestCase' ) ) {
$suite->addTestSuite( $class );
}
}
@@ -23,4 +24,4 @@ public static function suite() {
}
}
-chdir( $old_cwd );
+chdir( $old_cwd );
Please sign in to comment.
Something went wrong with that request. Please try again.