Skip to content

Commit 641658c

Browse files
committed
MAGETWO-56915: Versioning of static files (CSS, JS, Fonts, Images, etc.) doesn't enabled by default - for mainline
- Updating tests
1 parent 4bfd294 commit 641658c

File tree

8 files changed

+25
-13
lines changed

8 files changed

+25
-13
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testSaveFilePlaceholder($model)
4646
public function testGetUrlPlaceholder($model)
4747
{
4848
$this->assertStringMatchesFormat(
49-
'http://localhost/pub/static/frontend/%s/Magento_Catalog/images/product/placeholder/image.jpg',
49+
'http://localhost/pub/static/%s/frontend/%s/Magento_Catalog/images/product/placeholder/image.jpg',
5050
$model->getUrl()
5151
);
5252
}

dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testGetConfig()
4242
public function testGetConfigCssUrls()
4343
{
4444
$config = $this->_model->getConfig();
45-
$publicPathPattern = 'http://localhost/pub/static/adminhtml/Magento/backend/en_US/mage/%s';
45+
$publicPathPattern = 'http://localhost/pub/static/%s/adminhtml/Magento/backend/en_US/mage/%s';
4646
$this->assertStringMatchesFormat($publicPathPattern, $config->getPopupCss());
4747
$this->assertStringMatchesFormat($publicPathPattern, $config->getContentCss());
4848
}

dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testGetFilesCollection()
5858
$this->assertInstanceOf(\Magento\Framework\DataObject::class, $item);
5959
$this->assertStringEndsWith('/1.swf', $item->getUrl());
6060
$this->assertStringMatchesFormat(
61-
'http://%s/static/adminhtml/%s/%s/Magento_Cms/images/placeholder_thumbnail.jpg',
61+
'http://%s/static/%s/adminhtml/%s/%s/Magento_Cms/images/placeholder_thumbnail.jpg',
6262
$item->getThumbUrl()
6363
);
6464
return;

dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ public function cssDirectiveDataProvider()
283283
* @magentoComponentsDir Magento/Email/Model/_files/design
284284
* @magentoAppIsolation enabled
285285
* @magentoDbIsolation enabled
286+
* @magentoConfigFixture default_store dev/static/sign 0
286287
* @dataProvider inlinecssDirectiveDataProvider
287288
*
288289
* @param string $templateText

dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@ public function testGetProcessedTemplateSubject()
578578
->getArea(Area::AREA_FRONTEND)
579579
->load();
580580

581-
$expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico';
582581
$this->model->setTemplateSubject('{{view url="Magento_Theme::favicon.ico"}}');
583582
$this->model->setDesignConfig([
584583
'area' => 'frontend',
@@ -588,10 +587,16 @@ public function testGetProcessedTemplateSubject()
588587
]);
589588

590589
$this->setNotDefaultThemeForFixtureStore();
591-
$this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([]));
590+
$this->assertStringMatchesFormat(
591+
'%s/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico',
592+
$this->model->getProcessedTemplateSubject([])
593+
);
592594

593595
$this->setDefaultThemeForFixtureStore();
594-
$this->assertStringEndsWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([]));
596+
$this->assertStringMatchesFormat(
597+
'%s/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico',
598+
$this->model->getProcessedTemplateSubject([])
599+
);
595600
}
596601

597602
/**

dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,10 @@ public function testGetUrl()
477477
public function testGetViewFileUrl()
478478
{
479479
$actualResult = $this->_block->getViewFileUrl('css/styles.css');
480-
$this->assertStringMatchesFormat('http://localhost/pub/static/frontend/%s/en_US/css/styles.css', $actualResult);
480+
$this->assertStringMatchesFormat(
481+
'http://localhost/pub/static/%s/frontend/%s/en_US/css/styles.css',
482+
$actualResult
483+
);
481484
}
482485

483486
public function testGetModuleName()

dev/tests/integration/testsuite/Magento/Variable/Model/Variable/ConfigTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
2020

2121
protected function setUp()
2222
{
23-
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
23+
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
2424
\Magento\Variable\Model\Variable\Config::class
2525
);
2626
}
2727

2828
public function testGetWysiwygJsPluginSrc()
2929
{
3030
$src = $this->_model->getWysiwygJsPluginSrc();
31-
$this->assertStringStartsWith('http://localhost/pub/static/adminhtml/Magento/backend/en_US/mage/adminhtml/',
32-
$src);
33-
$this->assertStringEndsWith('editor_plugin.js', $src);
31+
$this->assertStringMatchesFormat(
32+
'http://localhost/pub/static/%s/adminhtml/Magento/backend/en_US/mage/adminhtml/%s/editor_plugin.js',
33+
$src
34+
);
3435
}
3536
}

dev/tests/integration/testsuite/Magento/Widget/Model/Widget/ConfigTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ public function testGetPluginSettings()
4343
$this->assertArrayHasKey('widget_window_url', $settings);
4444

4545
$jsFilename = $settings['widget_plugin_src'];
46-
$this->assertStringStartsWith('http://localhost/pub/static/adminhtml/Magento/backend/en_US/', $jsFilename);
47-
$this->assertStringEndsWith('editor_plugin.js', $jsFilename);
46+
$this->assertStringMatchesFormat(
47+
'http://localhost/pub/static/%s/adminhtml/Magento/backend/en_US/%s/editor_plugin.js',
48+
$jsFilename
49+
);
4850

4951
$this->assertInternalType('array', $settings['widget_placeholders']);
5052

0 commit comments

Comments
 (0)