Skip to content

Commit 7541e03

Browse files
committed
Merge remote-tracking branch 'origin/AC-10634-ce' into AC-10821
2 parents f8f6d63 + edf7732 commit 7541e03

File tree

28 files changed

+141
-121
lines changed

28 files changed

+141
-121
lines changed

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,15 @@ protected function setUp(): void
225225
'initWebsites',
226226
'initCategories'
227227
];
228+
$mockAddMethods = [
229+
'_headerColumns'
230+
];
228231
$mockMethods = array_merge($constructorMethods, [
229232
'_customHeadersMapping',
230233
'_prepareEntityCollection',
231234
'_getEntityCollection',
232235
'getWriter',
233236
'getExportData',
234-
'_headerColumns',
235237
'_customFieldsMapping',
236238
'getItemsPerPage',
237239
'paginateCollection',
@@ -243,7 +245,8 @@ protected function setUp(): void
243245
$this->advancedPricing = $this->getMockBuilder(
244246
AdvancedPricing::class
245247
)
246-
->setMethods($mockMethods)
248+
->addMethods($mockAddMethods)
249+
->onlyMethods($mockMethods)
247250
->disableOriginalConstructor()
248251
->getMock();
249252
foreach ($constructorMethods as $method) {

app/code/Magento/Authorization/Test/Unit/Model/ResourceModel/RulesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class RulesTest extends TestCase
3535
/**
3636
* Test constants
3737
*/
38-
const TEST_ROLE_ID = 13;
38+
private const TEST_ROLE_ID = 13;
3939

4040
/**
4141
* @var Rules

app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Auth/LoginTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
/**
3232
* Test for \Magento\Backend\Controller\Adminhtml\Auth\Login.
33+
*
34+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3335
*/
3436
class LoginTest extends TestCase
3537
{

app/code/Magento/Bundle/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/BundleTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
2-
declare(strict_types=1);
32
/**
4-
* Test class for \Magento\Bundle\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Bundle
5-
*
63
* Copyright © Magento, Inc. All rights reserved.
74
* See COPYING.txt for license details.
85
*/
6+
declare(strict_types=1);
97

108
namespace Magento\Bundle\Test\Unit\Controller\Adminhtml\Product\Initialization\Helper\Plugin;
119

app/code/Magento/Bundle/Test/Unit/Model/Plugin/PriceBackendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class PriceBackendTest extends TestCase
2020
{
21-
const CLOSURE_VALUE = 'CLOSURE';
21+
private const CLOSURE_VALUE = 'CLOSURE';
2222

2323
/** @var PriceBackend */
2424
private $priceBackendPlugin;

app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class DefaultTest extends TestCase
3232
/**
3333
* Expiration frame
3434
*/
35-
const EXPIRE_FRAME = 86400;
35+
private const EXPIRE_FRAME = 86400;
3636

3737
/**
3838
* Captcha default config data

app/code/Magento/Captcha/Test/Unit/Observer/CheckUserForgotPasswordBackendObserverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
*/
3030
class CheckUserForgotPasswordBackendObserverTest extends TestCase
3131
{
32-
const STUB_EMAIL = '[email protected]';
33-
const STUB_REQUEST_PARAMS = ['STUB_PARAM'];
32+
private const STUB_EMAIL = '[email protected]';
33+
private const STUB_REQUEST_PARAMS = ['STUB_PARAM'];
3434

3535
/**
3636
* @var MockObject|DataHelper

app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
class UpdateHandlerTest extends TestCase
3131
{
3232
/**
33-
* Magento\Framework\TestFramework\Unit\Helper\ObjectManager
33+
* @var Magento\Framework\TestFramework\Unit\Helper\ObjectManager
3434
*/
3535
private $objectManager;
3636

app/code/Magento/Cms/Test/Unit/Helper/PageTest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,20 @@ protected function setUp(): void
153153
->getMock();
154154
$this->pageFactoryMock = $this->getMockBuilder(PageFactory::class)
155155
->disableOriginalConstructor()
156-
->setMethods(['create'])
156+
->onlyMethods(['create'])
157157
->getMock();
158158
$this->pageMock = $this->getMockBuilder(\Magento\Cms\Model\Page::class)
159159
->disableOriginalConstructor()
160-
->setMethods(
160+
->addMethods(['setStoreId', 'getCustomPageLayout'])
161+
->onlyMethods(
161162
[
162163
'getId',
163-
'setStoreId',
164164
'load',
165165
'getCustomThemeFrom',
166166
'getCustomThemeTo',
167167
'getCustomTheme',
168168
'getPageLayout',
169169
'getIdentifier',
170-
'getCustomPageLayout',
171170
'getCustomLayoutUpdateXml',
172171
'getLayoutUpdateXml',
173172
'getContentHeading',
@@ -203,7 +202,7 @@ protected function setUp(): void
203202
$this->layoutProcessorMock = $this->getMockBuilder(ProcessorInterface::class)
204203
->getMockForAbstractClass();
205204
$this->blockMock = $this->getMockBuilder(AbstractBlock::class)
206-
->setMethods(['setContentHeading'])
205+
->addMethods(['setContentHeading'])
207206
->disableOriginalConstructor()
208207
->getMockForAbstractClass();
209208
$this->messagesBlockMock = $this->getMockBuilder(Messages::class)
@@ -398,7 +397,7 @@ public function testPrepareResultPage(
398397
/**
399398
* @return array
400399
*/
401-
public function renderPageExtendedDataProvider()
400+
public static function renderPageExtendedDataProvider()
402401
{
403402
return [
404403
'ids NOT EQUAL BUT page->load() NOT SUCCESSFUL' => [
@@ -501,7 +500,7 @@ public function testGetPageUrl(
501500
/**
502501
* @return array
503502
*/
504-
public function getPageUrlDataProvider()
503+
public static function getPageUrlDataProvider()
505504
{
506505
return [
507506
'ids NOT EQUAL BUT page->load() NOT SUCCESSFUL' => [

app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,10 @@ protected function setUp(): void
138138
->method('getDirectoryReadByPath')
139139
->willReturn($this->directoryReadMock);
140140
$this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class)
141-
->setMethods(
141+
->addMethods(['clearWebsiteCache'])
142+
->onlyMethods(
142143
[
143-
'clearWebsiteCache', 'getDefaultStoreView', 'getGroup', 'getGroups',
144+
'getDefaultStoreView', 'getGroup', 'getGroups',
144145
'getStore', 'getStores', 'getWebsite', 'getWebsites', 'hasSingleStore',
145146
'isSingleStoreMode', 'reinitStores', 'setCurrentStore', 'setIsSingleStoreModeAllowed',
146147
]
@@ -290,7 +291,7 @@ public function testConvertIdToPathAnyId($path, $pathId)
290291
/**
291292
* @return array
292293
*/
293-
public function providerConvertIdToPath()
294+
public static function providerConvertIdToPath()
294295
{
295296
return [
296297
['', ''],
@@ -318,7 +319,7 @@ public function testGetShortFilename($fileName, $maxLength, $expectedFilename)
318319
/**
319320
* @return array
320321
*/
321-
public function providerShortFilename()
322+
public static function providerShortFilename()
322323
{
323324
return [
324325
['test', 3, 'tes...'],
@@ -340,7 +341,7 @@ public function testGetShortFilenameDefaultMaxLength($fileName, $expectedFilenam
340341
/**
341342
* @return array
342343
*/
343-
public function providerShortFilenameDefaultMaxLength()
344+
public static function providerShortFilenameDefaultMaxLength()
344345
{
345346
return [
346347
['Mini text', 'Mini text'],
@@ -380,7 +381,7 @@ protected function generalSettingsIsUsingStaticUrlsAllowed($allowedValue)
380381
/**
381382
* @return array
382383
*/
383-
public function providerIsUsingStaticUrlsAllowed()
384+
public static function providerIsUsingStaticUrlsAllowed()
384385
{
385386
return [
386387
[true],
@@ -467,7 +468,7 @@ public function testGetCurrentPathThrowException()
467468
/**
468469
* @return array
469470
*/
470-
public function providerGetCurrentPath()
471+
public static function providerGetCurrentPath()
471472
{
472473
return [
473474
['L3Rlc3RfcGF0aA--', 'L3Rlc3RfcGF0aA--', 'PATH/test_path', true],
@@ -523,7 +524,7 @@ public function testGetImageHtmlDeclarationRenderingAsTag(
523524
/**
524525
* @return array
525526
*/
526-
public function providerGetImageHtmlDeclarationRenderingAsTag()
527+
public static function providerGetImageHtmlDeclarationRenderingAsTag()
527528
{
528529
return [
529530
[
@@ -572,7 +573,7 @@ public function testGetImageHtmlDeclaration($baseUrl, $fileName, $isUsingStaticU
572573
/**
573574
* @return array
574575
*/
575-
public function providerGetImageHtmlDeclaration()
576+
public static function providerGetImageHtmlDeclaration()
576577
{
577578
return [
578579
['http://localhost', 'test.png', true, 'http://localhost/test.png'],

0 commit comments

Comments
 (0)