-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #582 from magento-frontend/pr-develop
Fixed issues: - MAGETWO-59579: [Github #6943] grunt exec:<theme> doesn't work with @import</theme> - MAGETWO-57210: [github #6195, #4101] Gallery doesn't show all images added to configurable options - MAGETWO-59003: Js file version regenerated in browser on every page reload in develop mode
- Loading branch information
Showing
14 changed files
with
296 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
dev/tests/integration/testsuite/Magento/Framework/App/View/Deployment/VersionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Framework\App\View\Deployment; | ||
|
||
use Magento\Framework\App\Filesystem\DirectoryList; | ||
use Magento\Framework\App\ObjectManager; | ||
use Magento\Framework\App\State; | ||
use Magento\Framework\App\View\Deployment\Version\Storage\File; | ||
use Magento\Framework\Filesystem\Directory\WriteInterface; | ||
|
||
class VersionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var File | ||
*/ | ||
private $fileStorage; | ||
|
||
/** | ||
* @var WriteInterface | ||
*/ | ||
private $directoryWrite; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $fileName = 'deployed_version.txt'; | ||
|
||
public function setUp() | ||
{ | ||
$this->fileStorage = ObjectManager::getInstance()->create( | ||
File::class, | ||
[ | ||
'directoryCode' => DirectoryList::STATIC_VIEW, | ||
'fileName' => $this->fileName | ||
] | ||
); | ||
/** @var \Magento\TestFramework\App\Filesystem $filesystem */ | ||
$filesystem = ObjectManager::getInstance()->get(\Magento\TestFramework\App\Filesystem::class); | ||
$this->directoryWrite = $filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW); | ||
$this->removeDeployVersionFile(); | ||
} | ||
|
||
/** | ||
* @param string $mode | ||
* @return Version | ||
*/ | ||
public function getVersionModel($mode) | ||
{ | ||
$appState = ObjectManager::getInstance()->create( | ||
State::class, | ||
[ | ||
'mode' => $mode | ||
] | ||
); | ||
return ObjectManager::getInstance()->create( | ||
Version::class, | ||
[ | ||
'appState' => $appState | ||
] | ||
); | ||
} | ||
|
||
protected function tearDown() | ||
{ | ||
$this->removeDeployVersionFile(); | ||
} | ||
|
||
private function removeDeployVersionFile() | ||
{ | ||
if ($this->directoryWrite->isExist($this->fileName)) { | ||
$this->directoryWrite->delete($this->fileName); | ||
} | ||
} | ||
|
||
/** | ||
* @expectedException \UnexpectedValueException | ||
*/ | ||
public function testGetValueInProductionModeWithoutVersion() | ||
{ | ||
$this->assertFalse($this->directoryWrite->isExist($this->fileName)); | ||
$this->getVersionModel(State::MODE_PRODUCTION)->getValue(); | ||
} | ||
|
||
public function testGetValueInDeveloperMode() | ||
{ | ||
$this->assertFalse($this->directoryWrite->isExist($this->fileName)); | ||
$this->getVersionModel(State::MODE_DEVELOPER)->getValue(); | ||
$this->assertTrue($this->directoryWrite->isExist($this->fileName)); | ||
} | ||
|
||
/** | ||
* Assert that version is not regenerated on each request in developer mode | ||
*/ | ||
public function testGetValue() | ||
{ | ||
$this->assertFalse($this->directoryWrite->isExist($this->fileName)); | ||
$versionModel = $this->getVersionModel(State::MODE_DEVELOPER); | ||
$version = $versionModel->getValue(); | ||
$this->assertTrue($this->directoryWrite->isExist($this->fileName)); | ||
$this->assertEquals($version, $versionModel->getValue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.