From 84b0b747857f09da354f02b3108aa987e3591876 Mon Sep 17 00:00:00 2001 From: Dmytro Kvashnin <dkvashnin@ebay.com> Date: Mon, 16 Mar 2015 17:28:34 +0200 Subject: [PATCH] MAGETWO-33631: Advanced Developer Workflow - chain fixed --- .../Asset/PreProcessor/DeveloperChain.php | 2 - .../Asset/PreProcessor/DeveloperChainTest.php | 50 ------------------- .../View/Asset/PreProcessor/ChainFactory.php | 14 +++--- 3 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 app/code/Magento/Developer/Test/Unit/Model/VIew/Asset/PreProcessor/DeveloperChainTest.php diff --git a/app/code/Magento/Developer/Model/View/Asset/PreProcessor/DeveloperChain.php b/app/code/Magento/Developer/Model/View/Asset/PreProcessor/DeveloperChain.php index 636b5418fb5..9703008ff7d 100644 --- a/app/code/Magento/Developer/Model/View/Asset/PreProcessor/DeveloperChain.php +++ b/app/code/Magento/Developer/Model/View/Asset/PreProcessor/DeveloperChain.php @@ -6,7 +6,6 @@ namespace Magento\Developer\Model\View\Asset\PreProcessor; use Magento\Framework\View\Asset\PreProcessor\Chain; -use Magento\Developer\Model\Config\Source\WorkflowType; use Magento\Framework\View\Asset\LocalInterface; class DeveloperChain extends Chain @@ -16,7 +15,6 @@ class DeveloperChain extends Chain * @param string $origContent * @param string $origContentType * @param null $origAssetPath - * @param null $frontEndDevelopmentWorkflowType */ public function __construct( LocalInterface $asset, diff --git a/app/code/Magento/Developer/Test/Unit/Model/VIew/Asset/PreProcessor/DeveloperChainTest.php b/app/code/Magento/Developer/Test/Unit/Model/VIew/Asset/PreProcessor/DeveloperChainTest.php deleted file mode 100644 index 16a9f8a78c4..00000000000 --- a/app/code/Magento/Developer/Test/Unit/Model/VIew/Asset/PreProcessor/DeveloperChainTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Developer\Test\Unit\Model\View\Asset\PreProcessor; - -use Magento\Framework\View\Asset\LocalInterface; -use Magento\Developer\Model\View\Asset\PreProcessor\DeveloperChain; - -class DeveloperChainTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var LocalInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $asset; - - /** - * @var DeveloperChain - */ - private $object; - - protected function setUp() - { - $this->asset = $this->getMockForAbstractClass('\Magento\Framework\View\Asset\LocalInterface'); - } - - public function testChainTargetAssetPathDevMode() - { - $assetPath = 'assetPath'; - $origPath = 'origPath'; - - $this->asset = $this->getMockForAbstractClass('\Magento\Framework\View\Asset\LocalInterface'); - $this->asset->expects($this->once()) - ->method('getContentType') - ->will($this->returnValue('assetType')); - $this->asset->expects($this->once()) - ->method('getPath') - ->will($this->returnValue($assetPath)); - $this->object = new DeveloperChain( - $this->asset, - 'origContent', - 'origType', - $origPath - ); - - $this->assertSame($this->object->getTargetAssetPath(), $origPath); - $this->assertNotSame($this->object->getTargetAssetPath(), $assetPath); - } -} diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/ChainFactory.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/ChainFactory.php index c9e8d8d06db..e817380eff1 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/ChainFactory.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/ChainFactory.php @@ -30,15 +30,13 @@ class ChainFactory implements ChainFactoryInterface */ public function create(array $arguments = []) { - $arguments = array_diff_key( + $arguments = array_intersect_key( $arguments, - array_flip( - [ - 'asset', - 'origContent', - 'origContentType' - ] - ) + [ + 'asset' => 'asset', + 'origContent' => 'origContent', + 'origContentType' => 'origContentType' + ] ); return $this->_objectManager->create('Magento\Framework\View\Asset\PreProcessor\Chain', $arguments); } -- GitLab