Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/MAGETWO-56076' into bugs-pr-2.0-new
Browse files Browse the repository at this point in the history
  • Loading branch information
eug123 committed Sep 19, 2016
2 parents b8d2ae1 + 778272a commit c739a5d
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 30 deletions.
21 changes: 7 additions & 14 deletions app/code/Magento/Deploy/Model/DeployManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}
}
}
5 changes: 5 additions & 0 deletions app/code/Magento/Theme/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,10 @@ Disallow: /*SID=
</allowed_resources>
</media_storage_configuration>
</system>
<dev>
<static>
<sign>1</sign>
</static>
</dev>
</default>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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',
Expand All @@ -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([])
);
}

/**
Expand All @@ -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()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down

0 comments on commit c739a5d

Please sign in to comment.