Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG Fix PHPUnit autoloading problems in text collector

  • Loading branch information...
commit ec17d368bebc38c0632ab0f0ff29ea8946dd6227 1 parent 1f4b5db
@chillu chillu authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 i18n/i18nTextCollector.php
View
8 i18n/i18nTextCollector.php
@@ -328,6 +328,14 @@ public function collectFromTemplate($content, $fileName, $module) {
*/
function collectFromEntityProviders($filePath, $module = null) {
$entities = array();
+
+ // HACK Ugly workaround to avoid "Cannot redeclare class PHPUnit_Framework_TestResult" error
+ // when running text collector with PHPUnit 3.4. There really shouldn't be any dependencies
+ // here, but the class reflection enforces autloading of seemingly unrelated classes.
+ // The main problem here is the CMSMenu class, which iterates through test classes,
+ // which in turn trigger autoloading of PHPUnit.
+ $phpunitwrapper = PhpUnitWrapper::inst();
+ $phpunitwrapper->init();
$classes = ClassInfo::classes_for_file($filePath);
if($classes) foreach($classes as $class) {
Please sign in to comment.
Something went wrong with that request. Please try again.