Changeset 219
- Timestamp:
- 08/15/07 18:58:31 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/phing/tasks/ext/phpunit/BatchTest.php
r148 r219 24 24 /** 25 25 * Scans a list of files given by the fileset attribute, extracts 26 * all subclasses of PHPUnit(2)_Framework_TestCase .26 * all subclasses of PHPUnit(2)_Framework_TestCase / PHPUnit(2)_Framework_TestSuite. 27 27 * 28 28 * @author Michiel Rook <michiel.rook@gmail.com> … … 131 131 132 132 /** 133 * Checks wheter $input is a testcase subclass. 133 * Checks wheter $input is a subclass of PHPUnit(2)_Framework_TestCasse 134 * or PHPUnit(2)_Framework_TestSuite 134 135 */ 135 136 private function isTestCase($input) 136 137 { 137 return is_subclass_of($input, 'PHPUnit2_Framework_TestCase') || is_subclass_of($input, 'PHPUnit_Framework_TestCase'); 138 return is_subclass_of($input, 'PHPUnit2_Framework_TestCase') || is_subclass_of($input, 'PHPUnit_Framework_TestCase') 139 || is_subclass_of($input, 'PHPUnit2_Framework_TestSuite') || is_subclass_of($input, 'PHPUnit_Framework_TestSuite'); 138 140 } 139 141 140 142 /** 141 * Filters an array of classes, removes all classes that are not subclasses of PHPUnit(2)_Framework_TestCase,143 * Filters an array of classes, removes all classes that are not test cases or test suites, 142 144 * or classes that are declared abstract 143 145 */ … … 150 152 151 153 /** 152 * Returns an array of PHPUnit2_Framework_TestCase classes that are declared154 * Returns an array of test cases and test suites that are declared 153 155 * by the files included by the filesets 154 156 * 155 * @return array an array of PHPUnit 2_Framework_TestCase classes.157 * @return array an array of PHPUnit(2)_Framework_TestCase or PHPUnit(2)_Framework_TestSuite classes. 156 158 */ 157 159 function elements() trunk/classes/phing/tasks/ext/phpunit/PHPUnitTask.php
r208 r219 225 225 $suite = NULL; 226 226 227 if (PHPUnitUtil::$installedVersion == 3) 228 { 229 require_once 'PHPUnit/Framework/TestSuite.php'; 230 $suite = new PHPUnit_Framework_TestSuite(new ReflectionClass($test)); 227 if (is_subclass_of($test, 'PHPUnit_Framework_TestSuite') || is_subclass_of($test, 'PHPUnit2_Framework_TestSuite')) 228 { 229 $suite = $test; 231 230 } 232 231 else 233 232 { 234 require_once 'PHPUnit2/Framework/TestSuite.php'; 235 $suite = new PHPUnit2_Framework_TestSuite(new ReflectionClass($test)); 233 if (PHPUnitUtil::$installedVersion == 3) 234 { 235 require_once 'PHPUnit/Framework/TestSuite.php'; 236 $suite = new PHPUnit_Framework_TestSuite(new ReflectionClass($test)); 237 } 238 else 239 { 240 require_once 'PHPUnit2/Framework/TestSuite.php'; 241 $suite = new PHPUnit2_Framework_TestSuite(new ReflectionClass($test)); 242 } 236 243 } 237 244
