diff --git a/app/code/community/EcomDev/PHPUnit/Model/App.php b/app/code/community/EcomDev/PHPUnit/Model/App.php index 9ff3bd15..394b7f09 100644 --- a/app/code/community/EcomDev/PHPUnit/Model/App.php +++ b/app/code/community/EcomDev/PHPUnit/Model/App.php @@ -134,7 +134,20 @@ public static function applyTestScope() EcomDev_Utils_Reflection::setRestrictedPropertyValue('Mage', '_registry', array()); // All unit tests will be run in admin scope, to get rid of frontend restrictions - Mage::app()->initTest(); + // Init modules runs install process for table structures, + // It is required for setting up proper setup script + try { + set_error_handler(function ($errorCode, $errorMessage) { + echo $errorMessage, $errorCode; + debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + exit; + }); + Mage::app()->initTest(); + restore_error_handler(); + } catch (Exception $e) { + echo $e->getMessage(), "\n", $e->getTraceAsString(); + exit; + } } /** @@ -383,7 +396,6 @@ public function getResponse() protected function _getClassNameFromConfig($configPath, $interface = null) { $className = (string)$this->getConfig()->getNode($configPath); - $reflection = EcomDev_Utils_Reflection::getReflection($className); if ($interface !== null && !$reflection->implementsInterface($interface)) { throw new RuntimeException( diff --git a/composer.json b/composer.json index 082aa250..e06fd191 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "homepage": "http://www.ecomdev.org/shop/code-testing/php-unit-test-suite.html", "require": { "magento-hackathon/magento-composer-installer": "*", - "phpunit/phpunit": "4.1.*" + "phpunit/phpunit": "4.*" }, "replace": { "ivanchepurnyi/ecomdev_phpunit":"*"