We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit c7141393 authored by Christian Münch's avatar Christian Münch

Fix for autoloader problems with Varien_Autoload and PHPUnit extension

Posible fix for warnings throwed by Varien_Autoload which are triggered by PHPUnit (class_exist) calls.
parent ac0de6df
......@@ -22,3 +22,14 @@ $_SERVER['SCRIPT_FILENAME'] = $_baseDir . DS . 'index.php';
Mage::app('admin');
Mage::getConfig()->init();
spl_autoload_unregister(array(\Varien_Autoload::instance(), 'autoload'));
spl_autoload_register(function ($classname) {
$classname = ltrim($classname, "\\");
preg_match('/^(.+)?([^\\\\]+)$/U', $classname, $match);
$classname = str_replace("\\", "/", $match[1])
. str_replace(array("\\", "_"), "/", $match[2])
. ".php";
@include_once $classname;
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment