Skip to content

Commit fded3fc

Browse files
author
Yu Tang
committed
MAGETWO-44491: [TD] ActionInterface has Method dispatch() Instead of execute()
- Changed affected plugins
1 parent 9dcfff7 commit fded3fc

File tree

31 files changed

+82
-82
lines changed

31 files changed

+82
-82
lines changed

app/code/Magento/Backend/App/Action/Plugin/Authentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function __construct(
101101
* @return mixed
102102
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
103103
*/
104-
public function aroundDispatch(
104+
public function aroundExecute(
105105
\Magento\Backend\App\AbstractAction $subject,
106106
\Closure $proceed,
107107
\Magento\Framework\App\RequestInterface $request

app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class MassactionKey
1919
* @return mixed
2020
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2121
*/
22-
public function aroundDispatch(
22+
public function aroundExecute(
2323
\Magento\Backend\App\AbstractAction $subject,
2424
\Closure $proceed,
2525
\Magento\Framework\App\RequestInterface $request

app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function tearDown()
4545
$this->plugin = null;
4646
}
4747

48-
public function testAroundDispatchProlongStorage()
48+
public function testAroundExecuteProlongStorage()
4949
{
5050
$subject = $this->getMock('Magento\Backend\Controller\Adminhtml\Index', [], [], '', false);
5151
$request = $this->getMock('\Magento\Framework\App\Request\Http', ['getActionName'], [], '', false);
@@ -82,11 +82,11 @@ public function testAroundDispatchProlongStorage()
8282
return $expectedResult;
8383
};
8484

85-
$this->assertEquals($expectedResult, $this->plugin->aroundDispatch($subject, $proceed, $request));
85+
$this->assertEquals($expectedResult, $this->plugin->aroundExecute($subject, $proceed, $request));
8686
}
8787

8888
/**
89-
* Calls aroundDispatch to access protected method _processNotLoggedInUser
89+
* Calls aroundExecute to access protected method _processNotLoggedInUser
9090
*
9191
* Data provider supplies different possibilities of request parameters and properties
9292
* @dataProvider processNotLoggedInUserDataProvider
@@ -103,7 +103,7 @@ public function testProcessNotLoggedInUser($isIFrameParam, $isAjaxParam, $isForw
103103
->disableOriginalConstructor()
104104
->getMock();
105105

106-
// Stubs to control the flow of execution in aroundDispatch
106+
// Stubs to control the flow of execution in aroundExecute
107107
$this->auth->expects($this->any())->method('getAuthStorage')->will($this->returnValue($storage));
108108
$request->expects($this->once())->method('getActionName')->will($this->returnValue('non/open/action/name'));
109109
$this->auth->expects($this->any())->method('getUser')->willReturn(false);
@@ -146,7 +146,7 @@ public function testProcessNotLoggedInUser($isIFrameParam, $isAjaxParam, $isForw
146146
$proceed = function ($request) use ($expectedResult) {
147147
return $expectedResult;
148148
};
149-
$this->assertEquals($expectedResult, $this->plugin->aroundDispatch($subject, $proceed, $request));
149+
$this->assertEquals($expectedResult, $this->plugin->aroundExecute($subject, $proceed, $request));
150150
}
151151

152152
public function processNotLoggedInUserDataProvider()

app/code/Magento/Backend/Test/Unit/App/Action/Plugin/MassactionKeyTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ protected function setUp()
4949
}
5050

5151
/**
52-
* @covers \Magento\Backend\App\Action\Plugin\MassactionKey::aroundDispatch
52+
* @covers \Magento\Backend\App\Action\Plugin\MassactionKey::aroundExecute
5353
*
5454
* @param $postData array|string
5555
* @param array $convertedData
56-
* @dataProvider aroundDispatchDataProvider
56+
* @dataProvider aroundExecuteDataProvider
5757
*/
58-
public function testAroundDispatchWhenMassactionPrepareKeyRequestExists($postData, $convertedData)
58+
public function testAroundExecuteWhenMassactionPrepareKeyRequestExists($postData, $convertedData)
5959
{
6060
$this->requestMock->expects($this->at(0))
6161
->method('getPost')
@@ -71,11 +71,11 @@ public function testAroundDispatchWhenMassactionPrepareKeyRequestExists($postDat
7171

7272
$this->assertEquals(
7373
'Expected',
74-
$this->plugin->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock)
74+
$this->plugin->aroundExecute($this->subjectMock, $this->closureMock, $this->requestMock)
7575
);
7676
}
7777

78-
public function aroundDispatchDataProvider()
78+
public function aroundExecuteDataProvider()
7979
{
8080
return [
8181
'post_data_is_array' => [['key'], ['key']],
@@ -84,9 +84,9 @@ public function aroundDispatchDataProvider()
8484
}
8585

8686
/**
87-
* @covers \Magento\Backend\App\Action\Plugin\MassactionKey::aroundDispatch
87+
* @covers \Magento\Backend\App\Action\Plugin\MassactionKey::aroundExecute
8888
*/
89-
public function testAroundDispatchWhenMassactionPrepareKeyRequestNotExists()
89+
public function testAroundExecuteWhenMassactionPrepareKeyRequestNotExists()
9090
{
9191
$this->requestMock->expects($this->once())
9292
->method('getPost')
@@ -97,7 +97,7 @@ public function testAroundDispatchWhenMassactionPrepareKeyRequestNotExists()
9797

9898
$this->assertEquals(
9999
'Expected',
100-
$this->plugin->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock)
100+
$this->plugin->aroundExecute($this->subjectMock, $this->closureMock, $this->requestMock)
101101
);
102102
}
103103
}

app/code/Magento/Captcha/Model/Customer/Plugin/AjaxLogin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(
5757
* @SuppressWarnings(PHPMD.NPathComplexity)
5858
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
5959
*/
60-
public function aroundExecute(
60+
public function aroundExecuteInternal(
6161
\Magento\Customer\Controller\Ajax\Login $subject,
6262
\Closure $proceed
6363
) {

app/code/Magento/Captcha/Test/Unit/Model/Customer/Plugin/AjaxLoginTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function setUp()
8282
);
8383
}
8484

85-
public function testAroundExecute()
85+
public function testAroundExecuteInternal()
8686
{
8787
$username = 'name';
8888
$captchaString = 'string';
@@ -102,10 +102,10 @@ public function testAroundExecute()
102102
$closure = function () {
103103
return 'result';
104104
};
105-
$this->assertEquals('result', $this->model->aroundExecute($this->loginControllerMock, $closure));
105+
$this->assertEquals('result', $this->model->aroundExecuteInternal($this->loginControllerMock, $closure));
106106
}
107107

108-
public function testAroundExecuteIncorrectCaptcha()
108+
public function testAroundExecuteInternalIncorrectCaptcha()
109109
{
110110
$username = 'name';
111111
$captchaString = 'string';
@@ -131,15 +131,15 @@ public function testAroundExecuteIncorrectCaptcha()
131131

132132
$closure = function () {
133133
};
134-
$this->assertEquals('response', $this->model->aroundExecute($this->loginControllerMock, $closure));
134+
$this->assertEquals('response', $this->model->aroundExecuteInternal($this->loginControllerMock, $closure));
135135
}
136136

137137
/**
138-
* @dataProvider aroundExecuteCaptchaIsNotRequired
138+
* @dataProvider aroundExecuteInternalCaptchaIsNotRequired
139139
* @param string $username
140140
* @param array $requestContent
141141
*/
142-
public function testAroundExecuteCaptchaIsNotRequired($username, $requestContent)
142+
public function testAroundExecuteInternalCaptchaIsNotRequired($username, $requestContent)
143143
{
144144
$this->requestMock->expects($this->once())->method('getContent')->will($this->returnValue($requestContent));
145145

@@ -151,13 +151,13 @@ public function testAroundExecuteCaptchaIsNotRequired($username, $requestContent
151151
$closure = function () {
152152
return 'result';
153153
};
154-
$this->assertEquals('result', $this->model->aroundExecute($this->loginControllerMock, $closure));
154+
$this->assertEquals('result', $this->model->aroundExecuteInternal($this->loginControllerMock, $closure));
155155
}
156156

157157
/**
158158
* @return array
159159
*/
160-
public function aroundExecuteCaptchaIsNotRequired()
160+
public function aroundExecuteInternalCaptchaIsNotRequired()
161161
{
162162
return [
163163
[

app/code/Magento/Customer/Controller/Plugin/Account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
* @param RequestInterface $request
4242
* @return mixed
4343
*/
44-
public function aroundDispatch(
44+
public function aroundExecute(
4545
ActionInterface $subject,
4646
\Closure $proceed,
4747
RequestInterface $request

app/code/Magento/Customer/Model/App/Action/ContextPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
* @return mixed
4444
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4545
*/
46-
public function aroundDispatch(
46+
public function aroundExecute(
4747
\Magento\Framework\App\ActionInterface $subject,
4848
\Closure $proceed,
4949
\Magento\Framework\App\RequestInterface $request

app/code/Magento/Customer/Test/Unit/Controller/Plugin/AccountTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ protected function setUp()
8787
* @param boolean $isActionAllowed
8888
* @param boolean $isAuthenticated
8989
*
90-
* @dataProvider dataProviderAroundDispatch
90+
* @dataProvider dataProviderAroundExecute
9191
*/
92-
public function testAroundDispatch(
92+
public function testAroundExecute(
9393
$action,
9494
$allowedActions,
9595
$isActionAllowed,
@@ -128,11 +128,11 @@ public function testAroundDispatch(
128128
$plugin = new Account($this->session, $allowedActions);
129129
$this->assertEquals(
130130
self::EXPECTED_VALUE,
131-
$plugin->aroundDispatch($this->subject, $this->proceed, $this->request)
131+
$plugin->aroundExecute($this->subject, $this->proceed, $this->request)
132132
);
133133
}
134134

135-
public function dataProviderAroundDispatch()
135+
public function dataProviderAroundExecute()
136136
{
137137
return [
138138
[

app/code/Magento/Customer/Test/Unit/Model/App/Action/ContextPluginTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function setUp()
7474
}
7575

7676
/**
77-
* Test aroundDispatch
77+
* Test aroundExecute
7878
*/
79-
public function testAroundDispatch()
79+
public function testAroundExecute()
8080
{
8181
$this->customerSessionMock->expects($this->once())
8282
->method('getCustomerGroupId')
@@ -96,7 +96,7 @@ public function testAroundDispatch()
9696
);
9797
$this->assertEquals(
9898
'ExpectedValue',
99-
$this->plugin->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock)
99+
$this->plugin->aroundExecute($this->subjectMock, $this->closureMock, $this->requestMock)
100100
);
101101
}
102102
}

0 commit comments

Comments
 (0)