Example #1
0
 /**
  * Isolation is enabled, as we pollute config with rewrite values
  *
  * @param string $type
  * @param bool $useRewrites
  * @param bool $useStoreCode
  * @param string $expected
  * @dataProvider getBaseUrlDataProvider
  * @magentoAppIsolation enabled
  */
 public function testGetBaseUrl($type, $useRewrites, $useStoreCode, $expected)
 {
     /* config operations require store to be loaded */
     $this->_model->load('default');
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_USE_REWRITES, $useRewrites);
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, $useStoreCode);
     $actual = $this->_model->getBaseUrl($type);
     $this->assertEquals($expected, $actual);
 }
Example #2
0
 /**
  * Isolation is enabled, as we pollute config with rewrite values
  *
  * @param string $type
  * @param bool $useCustomEntryPoint
  * @param bool $useStoreCode
  * @param string $expected
  * @dataProvider getBaseUrlForCustomEntryPointDataProvider
  * @magentoAppIsolation enabled
  */
 public function testGetBaseUrlForCustomEntryPoint($type, $useCustomEntryPoint, $useStoreCode, $expected)
 {
     /* config operations require store to be loaded */
     $this->_model->load('default');
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_USE_REWRITES, false);
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, $useStoreCode);
     // emulate custom entry point
     $_SERVER['SCRIPT_FILENAME'] = 'custom_entry.php';
     if ($useCustomEntryPoint) {
         Mage::register('custom_entry_point', true);
     }
     $actual = $this->_model->getBaseUrl($type);
     $this->assertEquals($expected, $actual);
 }