Skip to content
This repository was archived by the owner on May 27, 2023. It is now read-only.

Commit e0b3595

Browse files
committed
Fix error reporting for issues happining during setup process, lift phpunit version to major one
1 parent 68bfe5b commit e0b3595

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

app/code/community/EcomDev/PHPUnit/Model/App.php

+14-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,20 @@ public static function applyTestScope()
134134
EcomDev_Utils_Reflection::setRestrictedPropertyValue('Mage', '_registry', array());
135135

136136
// All unit tests will be run in admin scope, to get rid of frontend restrictions
137-
Mage::app()->initTest();
137+
// Init modules runs install process for table structures,
138+
// It is required for setting up proper setup script
139+
try {
140+
set_error_handler(function ($errorCode, $errorMessage) {
141+
echo $errorMessage, $errorCode;
142+
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
143+
exit;
144+
});
145+
Mage::app()->initTest();
146+
restore_error_handler();
147+
} catch (Exception $e) {
148+
echo $e->getMessage(), "\n", $e->getTraceAsString();
149+
exit;
150+
}
138151
}
139152

140153
/**
@@ -383,7 +396,6 @@ public function getResponse()
383396
protected function _getClassNameFromConfig($configPath, $interface = null)
384397
{
385398
$className = (string)$this->getConfig()->getNode($configPath);
386-
387399
$reflection = EcomDev_Utils_Reflection::getReflection($className);
388400
if ($interface !== null && !$reflection->implementsInterface($interface)) {
389401
throw new RuntimeException(

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "http://www.ecomdev.org/shop/code-testing/php-unit-test-suite.html",
77
"require": {
88
"magento-hackathon/magento-composer-installer": "*",
9-
"phpunit/phpunit": "4.1.*"
9+
"phpunit/phpunit": "4.*"
1010
},
1111
"replace": {
1212
"ivanchepurnyi/ecomdev_phpunit":"*"

0 commit comments

Comments
 (0)