Skip to content

Commit

Permalink
Use is_subclass_of() to find tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Cornelius committed Jun 8, 2012
1 parent 762b5b2 commit df94b1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions all.php
Expand Up @@ -14,13 +14,14 @@
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 );
}
}
return $suite;
}
}

chdir( $old_cwd );
chdir( $old_cwd );

0 comments on commit df94b1c

Please sign in to comment.