Skip to content
This repository
Browse code

BUG Fix PHPUnit autoloading problems in text collector

  • Loading branch information...
commit ec17d368bebc38c0632ab0f0ff29ea8946dd6227 1 parent 1f4b5db
Ingo Schommer authored August 09, 2012

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  i18n/i18nTextCollector.php
8  i18n/i18nTextCollector.php
@@ -328,6 +328,14 @@ public function collectFromTemplate($content, $fileName, $module) {
328 328
 	 */
329 329
 	function collectFromEntityProviders($filePath, $module = null) {
330 330
 		$entities = array();
  331
+
  332
+		// HACK Ugly workaround to avoid "Cannot redeclare class PHPUnit_Framework_TestResult" error
  333
+		// when running text collector with PHPUnit 3.4. There really shouldn't be any dependencies
  334
+		// here, but the class reflection enforces autloading of seemingly unrelated classes.
  335
+		// The main problem here is the CMSMenu class, which iterates through test classes,
  336
+		// which in turn trigger autoloading of PHPUnit.
  337
+		$phpunitwrapper = PhpUnitWrapper::inst();
  338
+		$phpunitwrapper->init();
331 339
 		
332 340
 		$classes = ClassInfo::classes_for_file($filePath);
333 341
 		if($classes) foreach($classes as $class) {

0 notes on commit ec17d36

Please sign in to comment.
Something went wrong with that request. Please try again.