diff --git a/app/code/Magento/Deploy/Model/DeployManager.php b/app/code/Magento/Deploy/Model/DeployManager.php index 6dbb4cf48ba3c..81c08d0ad2621 100644 --- a/app/code/Magento/Deploy/Model/DeployManager.php +++ b/app/code/Magento/Deploy/Model/DeployManager.php @@ -108,6 +108,9 @@ public function deploy() { if ($this->idDryRun) { $this->output->writeln('Dry run. Nothing will be recorded to the target directory.'); + } else { + $version = (new \DateTime())->getTimestamp(); + $this->versionStorage->save($version); } /** @var DeployStrategyProvider $strategyProvider */ @@ -133,7 +136,10 @@ public function deploy() } $this->minifyTemplates(); - $this->saveDeployedVersion(); + + if (!$this->idDryRun) { + $this->output->writeln("New version of deployed files: {$version}"); + } return $result; } @@ -197,17 +203,4 @@ private function getProcessesAmount() { return isset($this->options[Options::JOBS_AMOUNT]) ? (int)$this->options[Options::JOBS_AMOUNT] : 0; } - - /** - * Save version of deployed files - * @return void - */ - private function saveDeployedVersion() - { - if (!$this->idDryRun) { - $version = (new \DateTime())->getTimestamp(); - $this->output->writeln("New version of deployed files: {$version}"); - $this->versionStorage->save($version); - } - } } diff --git a/app/code/Magento/Theme/etc/config.xml b/app/code/Magento/Theme/etc/config.xml index bd0db014a781b..b55b2c1d2735b 100644 --- a/app/code/Magento/Theme/etc/config.xml +++ b/app/code/Magento/Theme/etc/config.xml @@ -62,5 +62,10 @@ Disallow: /*SID= + + + 1 + + diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php index 04dac68782f81..9f2196ac19ca1 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php @@ -46,7 +46,7 @@ public function testSaveFilePlaceholder($model) public function testGetUrlPlaceholder($model) { $this->assertStringMatchesFormat( - 'http://localhost/pub/static/frontend/%s/Magento_Catalog/images/product/placeholder/image.jpg', + 'http://localhost/pub/static/%s/frontend/%s/Magento_Catalog/images/product/placeholder/image.jpg', $model->getUrl() ); } diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php index 07b55f5e9aeaf..fdb63a875282e 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php @@ -42,7 +42,7 @@ public function testGetConfig() public function testGetConfigCssUrls() { $config = $this->_model->getConfig(); - $publicPathPattern = 'http://localhost/pub/static/adminhtml/Magento/backend/en_US/mage/%s'; + $publicPathPattern = 'http://localhost/pub/static/%s/adminhtml/Magento/backend/en_US/mage/%s'; $this->assertStringMatchesFormat($publicPathPattern, $config->getPopupCss()); $this->assertStringMatchesFormat($publicPathPattern, $config->getContentCss()); } diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php index a3baf43c54949..523058759fa87 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -57,7 +57,7 @@ public function testGetFilesCollection() $this->assertInstanceOf('Magento\Framework\DataObject', $item); $this->assertStringEndsWith('/1.swf', $item->getUrl()); $this->assertStringMatchesFormat( - 'http://%s/static/adminhtml/%s/%s/Magento_Cms/images/placeholder_thumbnail.jpg', + 'http://%s/static/%s/adminhtml/%s/%s/Magento_Cms/images/placeholder_thumbnail.jpg', $item->getThumbUrl() ); return; diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php index f330749fa6418..a4ee39948e118 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php @@ -283,6 +283,7 @@ public function cssDirectiveDataProvider() * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled * @magentoDbIsolation enabled + * @magentoConfigFixture default_store dev/static/sign 0 * @dataProvider inlinecssDirectiveDataProvider * * @param string $templateText diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index a47c1aa0d8d9a..dab0750661eec 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -122,7 +122,7 @@ public function testGetProcessedTemplate() ->getArea(Area::AREA_FRONTEND) ->load(); - $expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico'; + $expectedViewUrl = '/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico'; $this->model->setDesignConfig([ 'area' => 'frontend', 'store' => $this->objectManager->get('Magento\Store\Model\StoreManagerInterface') @@ -578,7 +578,6 @@ public function testGetProcessedTemplateSubject() ->getArea(Area::AREA_FRONTEND) ->load(); - $expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico'; $this->model->setTemplateSubject('{{view url="Magento_Theme::favicon.ico"}}'); $this->model->setDesignConfig([ 'area' => 'frontend', @@ -588,10 +587,16 @@ public function testGetProcessedTemplateSubject() ]); $this->setNotDefaultThemeForFixtureStore(); - $this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([])); + $this->assertStringMatchesFormat( + '%s/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico', + $this->model->getProcessedTemplateSubject([]) + ); $this->setDefaultThemeForFixtureStore(); - $this->assertStringEndsWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([])); + $this->assertStringMatchesFormat( + '%s/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico', + $this->model->getProcessedTemplateSubject([]) + ); } /** @@ -605,7 +610,7 @@ public function testGetDefaultEmailLogo() ->load(); $this->assertStringEndsWith( - 'static/frontend/Magento/luma/en_US/Magento_Email/logo_email.png', + '/frontend/Magento/luma/en_US/Magento_Email/logo_email.png', $this->model->getDefaultEmailLogo() ); } diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php index de6031e9db0e3..260311b48b1ec 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php @@ -477,7 +477,10 @@ public function testGetUrl() public function testGetViewFileUrl() { $actualResult = $this->_block->getViewFileUrl('css/styles.css'); - $this->assertStringMatchesFormat('http://localhost/pub/static/frontend/%s/en_US/css/styles.css', $actualResult); + $this->assertStringMatchesFormat( + 'http://localhost/pub/static/%s/frontend/%s/en_US/css/styles.css', + $actualResult + ); } public function testGetModuleName() diff --git a/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php b/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php index 57cf616fd7c7a..967650a85271e 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php @@ -16,7 +16,7 @@ public function testListActionDesign($productId, $expectedDesign) $this->getRequest()->setParam('id', $productId); $this->dispatch('review/product/listAction'); $result = $this->getResponse()->getBody(); - $this->assertContains("static/frontend/{$expectedDesign}/en_US/Magento_Theme/favicon.ico", $result); + $this->assertContains("/frontend/{$expectedDesign}/en_US/Magento_Theme/favicon.ico", $result); } /** diff --git a/dev/tests/integration/testsuite/Magento/Variable/Model/Variable/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Variable/Model/Variable/ConfigTest.php index 36cdd82450ec5..4828cb68190e1 100644 --- a/dev/tests/integration/testsuite/Magento/Variable/Model/Variable/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Variable/Model/Variable/ConfigTest.php @@ -21,15 +21,16 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Variable\Model\Variable\Config' + \Magento\Variable\Model\Variable\Config::class ); } public function testGetWysiwygJsPluginSrc() { $src = $this->_model->getWysiwygJsPluginSrc(); - $this->assertStringStartsWith('http://localhost/pub/static/adminhtml/Magento/backend/en_US/mage/adminhtml/', - $src); - $this->assertStringEndsWith('editor_plugin.js', $src); + $this->assertStringMatchesFormat( + 'http://localhost/pub/static/%s/adminhtml/Magento/backend/en_US/mage/adminhtml/%s/editor_plugin.js', + $src + ); } } diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/ConfigTest.php index 42143e8a4ce4d..3e13f8daf5a60 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/ConfigTest.php @@ -43,8 +43,10 @@ public function testGetPluginSettings() $this->assertArrayHasKey('widget_window_url', $settings); $jsFilename = $settings['widget_plugin_src']; - $this->assertStringStartsWith('http://localhost/pub/static/adminhtml/Magento/backend/en_US/', $jsFilename); - $this->assertStringEndsWith('editor_plugin.js', $jsFilename); + $this->assertStringMatchesFormat( + 'http://localhost/pub/static/%s/adminhtml/Magento/backend/en_US/%s/editor_plugin.js', + $jsFilename + ); $this->assertInternalType('array', $settings['widget_placeholders']);