Skip to content

Commit bbe3ee0

Browse files
author
Oleksii Korshenko
authored
Merge pull request magento#1059 from magento-engcom/develop-prs
Public Pull Requests: magento#9355 magento#9354 magento#9353 magento#9352 magento#9351 magento#9350
2 parents 2f04074 + cb52dee commit bbe3ee0

30 files changed

+155
-149
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Framework\App\Test\Unit\Action;
8+
9+
use \Magento\Framework\App\Action\Action;
10+
11+
class ActionFake extends Action
12+
{
13+
/**
14+
* Fake action to check a method call from a parent
15+
*/
16+
public function execute()
17+
{
18+
$this->_forward(
19+
ActionTest::ACTION_NAME,
20+
ActionTest::CONTROLLER_NAME,
21+
ActionTest::MODULE_NAME,
22+
ActionTest::$actionParams
23+
);
24+
$this->_redirect(ActionTest::FULL_ACTION_NAME, ActionTest::$actionParams);
25+
return;
26+
}
27+
}

lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit\Action;
108

119
use \Magento\Framework\App\Action\Action;
@@ -185,20 +183,3 @@ public function testDispatchPostDispatch()
185183
$this->assertEquals($this->_responseMock, $this->action->dispatch($this->_requestMock));
186184
}
187185
}
188-
189-
class ActionFake extends Action
190-
{
191-
/**
192-
* Fake action to check a method call from a parent
193-
*/
194-
public function execute()
195-
{
196-
$this->_forward(
197-
ActionTest::ACTION_NAME,
198-
ActionTest::CONTROLLER_NAME,
199-
ActionTest::MODULE_NAME,
200-
ActionTest::$actionParams);
201-
$this->_redirect(ActionTest::FULL_ACTION_NAME, ActionTest::$actionParams);
202-
return;
203-
}
204-
}

lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit;
108

119
use \Magento\Framework\App\AreaList;
@@ -48,12 +46,12 @@ public function testGetCodeByFrontNameWhenAreaDoesNotContainFrontName()
4846
$this->_resolverFactory->expects(
4947
$this->any()
5048
)->method(
51-
'create'
52-
)->with(
53-
'testValue'
54-
)->will(
55-
$this->returnValue($resolverMock)
56-
);
49+
'create'
50+
)->with(
51+
'testValue'
52+
)->will(
53+
$this->returnValue($resolverMock)
54+
);
5755

5856
$actual = $this->_model->getCodeByFrontName('testFrontName');
5957
$this->assertEquals($expected, $actual);
@@ -106,7 +104,10 @@ public function testGetCodes()
106104
{
107105
$areas = ['area1' => 'value1', 'area2' => 'value2'];
108106
$this->_model = new \Magento\Framework\App\AreaList(
109-
$this->objectManagerMock, $this->_resolverFactory, $areas, ''
107+
$this->objectManagerMock,
108+
$this->_resolverFactory,
109+
$areas,
110+
''
110111
);
111112

112113
$expected = array_keys($areas);
@@ -118,7 +119,10 @@ public function testGetDefaultRouter()
118119
{
119120
$areas = ['area1' => ['router' => 'value1'], 'area2' => 'value2'];
120121
$this->_model = new \Magento\Framework\App\AreaList(
121-
$this->objectManagerMock, $this->_resolverFactory, $areas, ''
122+
$this->objectManagerMock,
123+
$this->_resolverFactory,
124+
$areas,
125+
''
122126
);
123127

124128
$this->assertEquals($this->_model->getDefaultRouter('area1'), $areas['area1']['router']);
@@ -131,7 +135,10 @@ public function testGetArea()
131135
$objectManagerMock = $this->getObjectManagerMockGetArea();
132136
$areas = ['area1' => ['router' => 'value1'], 'area2' => 'value2'];
133137
$this->_model = new AreaList(
134-
$objectManagerMock, $this->_resolverFactory, $areas, ''
138+
$objectManagerMock,
139+
$this->_resolverFactory,
140+
$areas,
141+
''
135142
);
136143

137144
$this->assertEquals($this->_model->getArea('testArea'), 'ok');

lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit;
108

119
use Magento\Framework\App\Bootstrap;
@@ -85,9 +83,27 @@ protected function setUp()
8583
'',
8684
false
8785
);
88-
$this->maintenanceMode = $this->getMock(\Magento\Framework\App\MaintenanceMode::class, ['isOn'], [], '', false);
89-
$this->remoteAddress = $this->getMock('Magento\Framework\HTTP\PhpEnvironment\RemoteAddress', [], [], '', false);
90-
$filesystem = $this->getMock(\Magento\Framework\Filesystem::class, [], [], '', false);
86+
$this->maintenanceMode = $this->getMock(
87+
\Magento\Framework\App\MaintenanceMode::class,
88+
['isOn'],
89+
[],
90+
'',
91+
false
92+
);
93+
$this->remoteAddress = $this->getMock(
94+
\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class,
95+
[],
96+
[],
97+
'',
98+
false
99+
);
100+
$filesystem = $this->getMock(
101+
\Magento\Framework\Filesystem::class,
102+
[],
103+
[],
104+
'',
105+
false
106+
);
91107

92108
$this->logger = $this->getMock(\Psr\Log\LoggerInterface::class);
93109

@@ -99,7 +115,7 @@ protected function setUp()
99115
[\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class, $this->remoteAddress],
100116
[\Magento\Framework\Filesystem::class, $filesystem],
101117
[\Magento\Framework\App\DeploymentConfig::class, $this->deploymentConfig],
102-
['Psr\Log\LoggerInterface', $this->logger],
118+
[\Psr\Log\LoggerInterface::class, $this->logger],
103119
];
104120

105121
$this->objectManager->expects($this->any())->method('get')
@@ -211,7 +227,7 @@ public function testIsDeveloperModeDataProvider()
211227
[State::MODE_DEVELOPER, State::MODE_PRODUCTION, true],
212228
[State::MODE_PRODUCTION, State::MODE_DEVELOPER, false],
213229
[null, State::MODE_DEVELOPER, true],
214-
[null, State::MODE_PRODUCTION, false],
230+
[null, State::MODE_PRODUCTION, false]
215231
];
216232
}
217233

@@ -280,7 +296,7 @@ public function assertMaintenanceDataProvider()
280296
{
281297
return [
282298
[true, false],
283-
[false, true],
299+
[false, true]
284300
];
285301
}
286302

lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit\ObjectManager;
108

119
use Magento\Framework\Serialize\SerializerInterface;
@@ -55,15 +53,18 @@ protected function setUp()
5553
false
5654
);
5755

58-
$this->readerFactoryMock->expects(
59-
$this->any()
60-
)->method(
61-
'create'
62-
)->will(
63-
$this->returnValue($this->readerMock)
56+
$this->readerFactoryMock->expects($this->any())
57+
->method('create')
58+
->will($this->returnValue($this->readerMock));
59+
60+
$this->cacheMock = $this->getMock(
61+
\Magento\Framework\App\Cache\Type\Config::class,
62+
[],
63+
[],
64+
'',
65+
false
6466
);
6567

66-
$this->cacheMock = $this->getMock(\Magento\Framework\App\Cache\Type\Config::class, [], [], '', false);
6768
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
6869

6970
$this->object = $objectManagerHelper->getObject(
@@ -98,7 +99,10 @@ public function testLoadNotCached($area)
9899
$this->cacheMock->expects($this->once())
99100
->method('save')
100101
->with($serializedData);
101-
$this->readerMock->expects($this->once())->method('read')->with($area)->will($this->returnValue($configData));
102+
$this->readerMock->expects($this->once())
103+
->method('read')
104+
->with($area)
105+
->will($this->returnValue($configData));
102106

103107
$this->serializerMock->expects($this->once())
104108
->method('serialize')

lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
namespace Magento\Framework\App\Test\Unit\Request;
119

1210
use Magento\Framework\App\Config\ScopeConfigInterface;
@@ -345,8 +343,10 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header
345343
->getMock();
346344
$configMock->expects($this->exactly($configCall))
347345
->method('getValue')
348-
->with(\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, ScopeConfigInterface::SCOPE_TYPE_DEFAULT)
349-
->willReturn($configOffloadHeader);
346+
->with(
347+
\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER,
348+
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
349+
)->willReturn($configOffloadHeader);
350350

351351
$this->objectManager->setBackwardCompatibleProperty($this->_model, 'appConfig', $configMock);
352352
$this->objectManager->setBackwardCompatibleProperty($this->_model, 'sslOffloadHeader', null);

lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit\Response;
108

119
use \Magento\Framework\App\Response\Http;
@@ -53,7 +51,8 @@ protected function setUp()
5351
)->disableOriginalConstructor()->getMock();
5452
$this->cookieManagerMock = $this->getMock(\Magento\Framework\Stdlib\CookieManagerInterface::class);
5553
$this->contextMock = $this->getMockBuilder(
56-
\Magento\Framework\App\Http\Context::class)->disableOriginalConstructor()
54+
\Magento\Framework\App\Http\Context::class
55+
)->disableOriginalConstructor()
5756
->getMock();
5857

5958
$this->dateTimeMock = $this->getMockBuilder(\Magento\Framework\Stdlib\DateTime::class)
@@ -87,7 +86,8 @@ public function testSendVary()
8786
$expectedCookieName = Http::COOKIE_VARY_STRING;
8887
$expectedCookieValue = 'SHA1 Serialized String';
8988
$sensitiveCookieMetadataMock = $this->getMockBuilder(
90-
\Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata::class)
89+
\Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata::class
90+
)
9191
->disableOriginalConstructor()
9292
->getMock();
9393
$sensitiveCookieMetadataMock->expects($this->once())

lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerListTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit\Router;
108

119
class NoRouteHandlerListTest extends \PHPUnit_Framework_TestCase

lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* See COPYING.txt for license details.
77
*/
88

9-
// @codingStandardsIgnoreFile
10-
119
namespace Magento\Framework\App\Test\Unit\Router;
1210

1311
class NoRouteHandlerTest extends \Magento\Framework\TestFramework\Unit\BaseTestCase

lib/internal/Magento/Framework/App/Test/Unit/StateTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit;
108

119
use \Magento\Framework\App\Area;

lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\App\Test\Unit;
108

119
use Magento\Framework\App\Bootstrap;
@@ -77,7 +75,11 @@ protected function setUp()
7775
$this->objectManager = $this->getMockForAbstractClass(\Magento\Framework\ObjectManagerInterface::class);
7876
$this->logger = $this->getMockForAbstractClass(\Psr\Log\LoggerInterface::class);
7977
$this->configLoader = $this->getMock(
80-
\Magento\Framework\App\ObjectManager\ConfigLoader::class, [], [], '', false
78+
\Magento\Framework\App\ObjectManager\ConfigLoader::class,
79+
[],
80+
[],
81+
'',
82+
false
8183
);
8284
$this->object = new \Magento\Framework\App\StaticResource(
8385
$this->state,
@@ -204,7 +206,7 @@ public function testCatchExceptionDeveloperMode()
204206
{
205207
$this->objectManager->expects($this->once())
206208
->method('get')
207-
->with('Psr\Log\LoggerInterface')
209+
->with(\Psr\Log\LoggerInterface::class)
208210
->willReturn($this->logger);
209211
$this->logger->expects($this->once())
210212
->method('critical');

0 commit comments

Comments
 (0)