diff --git a/app/code/core/Mage/Core/Controller/Front/Router.php b/app/code/core/Mage/Core/Controller/Front/Router.php index 8959199b24f..f2d7449eadf 100644 --- a/app/code/core/Mage/Core/Controller/Front/Router.php +++ b/app/code/core/Mage/Core/Controller/Front/Router.php @@ -52,51 +52,4 @@ public function addRoutes(Zend_Controller_Router_Interface $router) return $this; } - - /** - * @param string|array $params - * @return string -- */ - public function getUrl($params = []) - { - static $reservedKeys = ['module' => 1, 'controller' => 1, 'action' => 1, 'array' => 1]; - - if (is_string($params)) { - $paramsArr = explode('/', $params); - $params = ['controller' => $paramsArr[0], 'action' => $paramsArr[1]]; - } - - $url = Mage::getBaseUrl(); - - if (!empty($params['frontName'])) { - $url .= $params['frontName'] . '/'; - } else { - $url .= $this->_config->getName() . '/'; - } - - if (!empty($params)) { - $paramsStr = ''; - foreach ($params as $key => $value) { - if (!isset($reservedKeys[$key]) && $key[0] !== '_' && !empty($value)) { - $paramsStr .= $key . '/' . $value . '/'; - } - } - - if (empty($params['controller']) && !empty($paramsStr)) { - $params['controller'] = 'index'; - } - $url .= empty($params['controller']) ? '' : $params['controller'] . '/'; - - if (empty($params['action']) && !empty($paramsStr)) { - $params['action'] = 'index'; - } - $url .= empty($params['action']) ? '' : $params['action'] . '/'; - - $url .= $paramsStr; - - $url .= empty($params['array']) ? '' : '?' . http_build_query($params['array']); - } - - return $url; - } } diff --git a/tests/unit/Mage/Core/Controller/Front/RouterTest.php b/tests/unit/Mage/Core/Controller/Front/RouterTest.php deleted file mode 100644 index 7ff22bd2ce6..00000000000 --- a/tests/unit/Mage/Core/Controller/Front/RouterTest.php +++ /dev/null @@ -1,44 +0,0 @@ -'); - $this->subject = new Mage_Core_Controller_Front_Router($config); - } - - /** - * @group Mage_Core - * @group Mage_Core_Controller - */ - public function testGetUrl(): void - { - $this->assertStringEndsWith('test-url/', $this->subject->getUrl()); - } -}