From 08ec831ff8a6bfaf91fe87b369a8fb0bb6d357da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Wed, 26 Mar 2014 11:32:09 +0800 Subject: [PATCH] MDL-44510 fix class guessing in phpunit 4 --- lib/phpunit/classes/autoloader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/phpunit/classes/autoloader.php b/lib/phpunit/classes/autoloader.php index 15fb42714ee11..611512b3d3127 100644 --- a/lib/phpunit/classes/autoloader.php +++ b/lib/phpunit/classes/autoloader.php @@ -164,10 +164,10 @@ protected function guess_class_from_path($file) { // Somebody is using just the file name, we need to look inside the file and guess the testcase // class name. Let's throw fatal error if there are more testcases in one file. - PHPUnit_Util_Class::collectStart(); + $classes = get_declared_classes(); PHPUnit_Util_Fileloader::checkAndLoad($file); $includePathFilename = stream_resolve_include_path($file); - $loadedClasses = PHPUnit_Util_Class::collectEnd(); + $loadedClasses = array_diff(get_declared_classes(), $classes); $candidates = array();