Skip to content

Commit 2f0d65a

Browse files
committed
Code Review changes
1 parent 306048c commit 2f0d65a

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

app/code/Magento/Store/etc/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@
6565
<preference for="Magento\Framework\App\Router\PathConfigInterface" type="Magento\Store\Model\PathConfig" />
6666
<type name="Magento\Framework\App\ActionInterface">
6767
<plugin name="storeCheck" type="Magento\Store\App\Action\Plugin\StoreCheck"/>
68-
<plugin name="designLoader" type="Magento\Framework\App\Action\Plugin\Design"/>
69-
<plugin name="eventDispatch" type="Magento\Framework\App\Action\Plugin\EventDispatchPlugin"/>
70-
<plugin name="actionFlagNoDispatch" type="Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin"/>
7168
</type>
7269
<type name="Magento\Framework\Url\SecurityInfo">
7370
<plugin name="storeUrlSecurityInfo" type="Magento\Store\Url\Plugin\SecurityInfo"/>

app/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,11 @@
17741774
</argument>
17751775
</arguments>
17761776
</type>
1777+
<type name="Magento\Framework\App\ActionInterface">
1778+
<plugin name="designLoader" type="Magento\Framework\App\Action\Plugin\LoadDesignPlugin"/>
1779+
<plugin name="eventDispatch" type="Magento\Framework\App\Action\Plugin\EventDispatchPlugin"/>
1780+
<plugin name="actionFlagNoDispatch" type="Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin"/>
1781+
</type>
17771782
<type name="Magento\Framework\App\ScopeResolverPool">
17781783
<arguments>
17791784
<argument name="scopeResolvers" xsi:type="array">

lib/internal/Magento/Framework/App/Action/Plugin/Design.php renamed to lib/internal/Magento/Framework/App/Action/Plugin/LoadDesignPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Handling Exceptions on Design Loading
1818
*/
19-
class Design
19+
class LoadDesignPlugin
2020
{
2121
/**
2222
* @var DesignLoader

lib/internal/Magento/Framework/App/Test/Unit/Action/Plugin/DesignTest.php

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Framework\App\Test\Unit\Action\Plugin;
7+
8+
use Magento\Framework\App\Action\Action;
9+
use Magento\Framework\App\Action\Plugin\LoadDesignPlugin;
10+
use Magento\Framework\App\ActionInterface;
11+
use Magento\Framework\Message\ManagerInterface;
12+
use Magento\Framework\View\DesignLoader;
13+
use PHPUnit\Framework\MockObject\MockObject;
14+
use PHPUnit\Framework\TestCase;
15+
16+
class DesignTest extends TestCase
17+
{
18+
public function testBeforeExecute()
19+
{
20+
/** @var MockObject|ActionInterface $actionMock */
21+
$actionMock = $this->createMock(Action::class);
22+
23+
/** @var MockObject|DesignLoader $designLoaderMock */
24+
$designLoaderMock = $this->createMock(DesignLoader::class);
25+
26+
/** @var MockObject|ManagerInterface $messageManagerMock */
27+
$messageManagerMock = $this->createMock(ManagerInterface::class);
28+
29+
$plugin = new LoadDesignPlugin($designLoaderMock, $messageManagerMock);
30+
31+
$designLoaderMock->expects($this->once())->method('load');
32+
$plugin->beforeExecute($actionMock);
33+
}
34+
}

0 commit comments

Comments
 (0)