Permalink
Browse files

- Merge [4636].

  • Loading branch information...
1 parent 07aec63 commit 319d6c33b07fbf90c11fc6612611cc6a56d19613 @sebastianbergmann committed Feb 14, 2009
Showing with 13 additions and 9 deletions.
  1. +13 −9 PHPUnit/Runner/StandardTestSuiteLoader.php
@@ -80,6 +80,8 @@ public function load($suiteClassName, $suiteClassFile = '', $syntaxCheck = TRUE)
$suiteClassFile = str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $suiteClassName) . '.php';
}
+ $suiteClassFile = realpath($suiteClassFile);
+
if (!class_exists($suiteClassName, FALSE)) {
if (!file_exists($suiteClassFile)) {
$includePaths = explode(PATH_SEPARATOR, get_include_path());
@@ -114,18 +116,20 @@ public function load($suiteClassName, $suiteClassFile = '', $syntaxCheck = TRUE)
foreach ($loadedClasses as $loadedClass) {
$class = new ReflectionClass($loadedClass);
- if ($class->isSubclassOf('PHPUnit_Framework_TestCase')) {
- $suiteClassName = $loadedClass;
- break;
- }
-
- if ($class->hasMethod('suite')) {
- $method = $class->getMethod('suite');
-
- if (!$method->isAbstract() && $method->isPublic() && $method->isStatic()) {
+ if ($class->getFileName() == $suiteClassFile) {
+ if ($class->isSubclassOf('PHPUnit_Framework_TestCase')) {
$suiteClassName = $loadedClass;
break;
}
+
+ if ($class->hasMethod('suite')) {
+ $method = $class->getMethod('suite');
+
+ if (!$method->isAbstract() && $method->isPublic() && $method->isStatic()) {
+ $suiteClassName = $loadedClass;
+ break;
+ }
+ }
}
}
}

0 comments on commit 319d6c3

Please sign in to comment.