Permalink
Browse files

Merge pull request #272 from wrobel/Fix_test_suite_class_name_detection

Fix class name detection when extending from another test suite.
  • Loading branch information...
sebastianbergmann committed Jun 14, 2011
2 parents d603af8 + 84699a0 commit b7bf7de8011e2d6797b028b4e5a00f52053745b3
Showing with 4 additions and 2 deletions.
  1. +4 −2 PHPUnit/Runner/StandardTestSuiteLoader.php
@@ -76,15 +76,17 @@ public function load($suiteClassName, $suiteClassFile = '', $syntaxCheck = FALSE
if (!class_exists($suiteClassName, FALSE)) {
PHPUnit_Util_Class::collectStart();
- PHPUnit_Util_Fileloader::checkAndLoad($suiteClassFile, $syntaxCheck);
+ $filename = PHPUnit_Util_Fileloader::checkAndLoad($suiteClassFile, $syntaxCheck);
$loadedClasses = PHPUnit_Util_Class::collectEnd();
}
if (!class_exists($suiteClassName, FALSE) && !empty($loadedClasses)) {
$offset = 0 - strlen($suiteClassName);
foreach ($loadedClasses as $loadedClass) {
- if (substr($loadedClass, $offset) === $suiteClassName) {
+ $class = new ReflectionClass($loadedClass);
+ if (substr($loadedClass, $offset) === $suiteClassName &&
+ $class->getFileName() == $filename) {
$suiteClassName = $loadedClass;
break;
}

0 comments on commit b7bf7de

Please sign in to comment.