Commit 9b5915f1 authored by Ivan Chepurnyi's avatar Ivan Chepurnyi

Fix phpunit extension to run on remote server

parent 5ab89309
...@@ -349,6 +349,13 @@ class EcomDev_PHPUnit_Controller_Request_Http ...@@ -349,6 +349,13 @@ class EcomDev_PHPUnit_Controller_Request_Http
public function getHttpHost($trimPort = false) public function getHttpHost($trimPort = false)
{ {
$baseUrl = $this->getBaseUrl(); $baseUrl = $this->getBaseUrl();
if (!$baseUrl) {
$baseUrl = Mage::app()->getConfig()->getNode(
EcomDev_PHPUnit_Model_Config::XML_PATH_UNSECURE_BASE_URL
);
}
$parts = parse_url($baseUrl); $parts = parse_url($baseUrl);
if (!isset($parts['host'])) { if (!isset($parts['host'])) {
......
...@@ -20,6 +20,12 @@ if (!Mage::isInstalled()) { ...@@ -20,6 +20,12 @@ if (!Mage::isInstalled()) {
$_SERVER['SCRIPT_NAME'] = $_baseDir . DS . 'index.php'; $_SERVER['SCRIPT_NAME'] = $_baseDir . DS . 'index.php';
$_SERVER['SCRIPT_FILENAME'] = $_baseDir . DS . 'index.php'; $_SERVER['SCRIPT_FILENAME'] = $_baseDir . DS . 'index.php';
// This fix allows running Magento Unit Tests
// from remote PHPUnit execution in vagrant box over PHPStorm
if (!empty($_GET)) {
$_GET = array();
}
Mage::app('admin'); Mage::app('admin');
Mage::getConfig()->init(); Mage::getConfig()->init();
......
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