-
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 #402 from magento-frontend/bugs-pr-2.0
Frontend Bugs - 2.0.11 - MAGETWO-57509 [Backport] - [GitHub] Javascript Bundling produces huge 13MB js files #4506 - for 2.0 - MAGETWO-56076 [Backport] Versioning of static files (CSS, JS, Fonts, Images, etc.) doesn't enabled by default - for 2.0
- Loading branch information
Showing
19 changed files
with
229 additions
and
95 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
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
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
94 changes: 94 additions & 0 deletions
94
lib/internal/Magento/Framework/Config/Test/Unit/ViewFactoryTest.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,94 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Framework\Config\Test\Unit; | ||
|
||
class ViewFactoryTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
const AREA = 'frontend'; | ||
|
||
/** | ||
* @var \Magento\Framework\Config\ViewFactory | ||
*/ | ||
protected $model; | ||
|
||
/** | ||
* @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $objectManager; | ||
|
||
/** | ||
* @var \Magento\Framework\View\Design\ThemeInterface|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $theme; | ||
|
||
/** | ||
* @var \Magento\Framework\Config\View|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $view; | ||
|
||
protected function setUp() | ||
{ | ||
$this->objectManager = $this->getMock(\Magento\Framework\ObjectManagerInterface::class); | ||
$this->model = new \Magento\Framework\Config\ViewFactory($this->objectManager); | ||
$this->theme = $this->getMock(\Magento\Framework\View\Design\ThemeInterface::class); | ||
$this->view = $this->getMock(\Magento\Framework\Config\View::class, [], [], '', false); | ||
} | ||
|
||
public function testCreate() | ||
{ | ||
$this->objectManager->expects($this->once()) | ||
->method('create') | ||
->with(\Magento\Framework\Config\View::class, []) | ||
->willReturn($this->view); | ||
$this->assertEquals($this->view, $this->model->create()); | ||
} | ||
|
||
public function testCreateWithArguments() | ||
{ | ||
/** @var \Magento\Theme\Model\View\Design|\PHPUnit_Framework_MockObject_MockObject $design */ | ||
$design = $this->getMock(\Magento\Theme\Model\View\Design::class, [], [], '', false); | ||
$design->expects($this->once()) | ||
->method('setDesignTheme') | ||
->with($this->theme, self::AREA); | ||
|
||
/** @var \Magento\Framework\Config\FileResolver|\PHPUnit_Framework_MockObject_MockObject $fileResolver */ | ||
$fileResolver = $this->getMock(\Magento\Framework\Config\FileResolver::class, [], [], '', false); | ||
|
||
$valueMap = [ | ||
[\Magento\Theme\Model\View\Design::class, [], $design], | ||
[\Magento\Framework\Config\FileResolver::class, ['designInterface' => $design], $fileResolver], | ||
[\Magento\Framework\Config\View::class, ['fileResolver' => $fileResolver], $this->view], | ||
]; | ||
$this->objectManager->expects($this->exactly(3)) | ||
->method('create') | ||
->willReturnMap($valueMap); | ||
|
||
$this->assertEquals($this->view, $this->model->create($this->getArguments())); | ||
} | ||
|
||
/** | ||
* @expectedException \Magento\Framework\Exception\LocalizedException | ||
* @expectedExceptionMessage wrong theme doesn't implement ThemeInterface | ||
*/ | ||
public function testCreateException() | ||
{ | ||
$this->model->create([ | ||
'themeModel' => 'wrong theme', | ||
'area' => self::AREA | ||
]); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
protected function getArguments() | ||
{ | ||
return [ | ||
'themeModel' => $this->theme, | ||
'area' => self::AREA | ||
]; | ||
} | ||
} |
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
Oops, something went wrong.