예제 #1
0
 /**
  * @magentoConfigFixture current_store web/unsecure/base_link_url http://example.com/
  * @magentoConfigFixture admin_store web/unsecure/base_link_url http://example.com/
  */
 public function testStoreDirective()
 {
     $url = $this->_model->storeDirective(array('{{store direct_url="arbitrary_url/"}}', 'store', ' direct_url="arbitrary_url/"'));
     $this->assertStringMatchesFormat('http://example.com/%sarbitrary_url/', $url);
     $url = $this->_model->storeDirective(array('{{store url="translation/ajax/index"}}', 'store', ' url="translation/ajax/index"'));
     $this->assertStringMatchesFormat('http://example.com/%stranslation/ajax/index/', $url);
     $this->_model->setStoreId(0);
     $url = $this->_model->storeDirective(array('{{store url="translation/ajax/index"}}', 'store', ' url="translation/ajax/index"'));
     $this->assertStringMatchesFormat('http://example.com/index.php/backend/translation/ajax/index/%A', $url);
 }
예제 #2
0
 /**
  * @magentoConfigFixture current_store web/unsecure/base_link_url http://example.com/
  * @magentoConfigFixture admin_store web/unsecure/base_link_url http://example.com/
  */
 public function testStoreDirective()
 {
     $url = $this->_model->storeDirective(['{{store direct_url="arbitrary_url/"}}', 'store', ' direct_url="arbitrary_url/"']);
     $this->assertStringMatchesFormat('http://example.com/%sarbitrary_url/', $url);
     $url = $this->_model->storeDirective(['{{store url="translation/ajax/index"}}', 'store', ' url="translation/ajax/index"']);
     $this->assertStringMatchesFormat('http://example.com/%stranslation/ajax/index/', $url);
     $this->_model->setStoreId(0);
     $backendUrlModel = $this->_objectManager->create('Magento\\Backend\\Model\\Url');
     $this->_model->setUrlModel($backendUrlModel);
     $url = $this->_model->storeDirective(['{{store url="translation/ajax/index"}}', 'store', ' url="translation/ajax/index"']);
     $this->assertStringMatchesFormat('http://example.com/index.php/backend/translation/ajax/index/%A', $url);
 }