Skip to content

Commit dbcf34d

Browse files
committed
PHPUnit 10 static test fixes
2 parents 6a466b4 + ca4280f commit dbcf34d

File tree

10 files changed

+29
-23
lines changed

10 files changed

+29
-23
lines changed

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-
public const TEST_ROLE_ID = 13;
38+
private const TEST_ROLE_ID = 13;
3939

4040
/**
4141
* @var Rules

app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/StockTest.php

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

1919
class StockTest extends TestCase
2020
{
21-
public const ATTRIBUTE_NAME = 'quantity_and_stock_status';
21+
private const ATTRIBUTE_NAME = 'quantity_and_stock_status';
2222

2323
/**
2424
* @var Stock

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/FlatTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
*/
2626
class FlatTest extends TestCase
2727
{
28-
public const STORE_ID = 1;
29-
public const TABLE_NAME = 'test_table';
30-
public const PARENT_PATH = '1';
31-
public const SORTED = false;
32-
public const PARENT = 1;
33-
public const RECURSION_LEVEL = 0;
28+
private const STORE_ID = 1;
29+
private const TABLE_NAME = 'test_table';
30+
private const PARENT_PATH = '1';
31+
private const SORTED = false;
32+
private const PARENT = 1;
33+
private const RECURSION_LEVEL = 0;
3434

3535
/**
3636
* @var CollectionFactory|MockObject

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/GalleryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ public function testBindValueToEntityRecordExists(): void
332332

333333
/**
334334
* @return void
335+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
335336
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
336337
*/
337338
public function testLoadGallery(): void

app/code/Magento/Catalog/Test/Unit/Ui/Component/Listing/Columns/AttributeSetTextTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
class AttributeSetTextTest extends AbstractColumnTestCase
1616
{
17-
public const ATTRIBUTE_SET_ID = 4;
18-
public const ATTRIBUTE_SET_NAME = 'Default';
17+
private const ATTRIBUTE_SET_ID = 4;
18+
private const ATTRIBUTE_SET_NAME = 'Default';
1919

2020
/**
2121
* @var AttributeSetRepositoryInterface|MockObject

app/code/Magento/Catalog/Test/Unit/Ui/Component/Listing/Columns/StatusTextTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
class StatusTextTest extends AbstractColumnTestCase
1616
{
17-
public const STATUS_ID = 1;
18-
public const STATUS_TEXT = 'Enabled';
17+
private const STATUS_ID = 1;
18+
private const STATUS_TEXT = 'Enabled';
1919

2020
/**
2121
* @var Status|MockObject

app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/StockItemRepositoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
use PHPUnit\Framework\TestCase;
3535

3636
/**
37+
* @SuppressWarnings(PHPMD.TooManyFields)
3738
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3839
*/
3940
class StockItemRepositoryTest extends TestCase

app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/Collection/SalableProcessorTest.php

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

1919
class SalableProcessorTest extends TestCase
2020
{
21-
public const STOCK_FLAG = 'has_stock_status_filter';
21+
private const STOCK_FLAG = 'has_stock_status_filter';
2222

2323
/** @var ObjectManager */
2424
private $objectManager;

app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,31 @@
3737
class DobTest extends TestCase
3838
{
3939
/** Constants used in the unit tests */
40-
public const MIN_DATE = '01/01/2010';
40+
private const MIN_DATE = '01/01/2010';
4141

42-
public const MAX_DATE = '01/01/2020';
42+
private const MAX_DATE = '01/01/2020';
4343

44-
public const DATE = '01/01/2014';
44+
private const DATE = '01/01/2014';
4545

46-
public const DAY = '01';
46+
private const DAY = '01';
4747

4848
// Value of date('d', strtotime(self::DATE))
49-
public const MONTH = '01';
49+
private const MONTH = '01';
5050

5151
// Value of date('m', strtotime(self::DATE))
52-
public const YEAR = '2014';
52+
private const YEAR = '2014';
5353

5454
// Value of date('Y', strtotime(self::DATE))
55-
public const DATE_FORMAT = 'M/dd/y';
55+
private const DATE_FORMAT = 'M/dd/y';
5656

5757
/** Constants used by Dob::setDateInput($code, $html) */
58-
public const DAY_HTML =
58+
private const DAY_HTML =
5959
'<div><label for="day"><span>d</span></label><input type="text" id="day" name="Day" value="1"></div>';
6060

61-
public const MONTH_HTML =
61+
private const MONTH_HTML =
6262
'<div><label for="month"><span>M</span></label><input type="text" id="month" name="Month" value="jan"></div>';
6363

64-
public const YEAR_HTML =
64+
private const YEAR_HTML =
6565
'<div><label for="year"><span>yy</span></label><input type="text" id="year" name="Year" value="14"></div>';
6666

6767
/** @var MockObject|AttributeMetadataInterface */

lib/internal/Magento/Framework/Data/Test/Unit/SearchCriteriaBuilderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1414
use PHPUnit\Framework\TestCase;
1515

16+
/**
17+
*
18+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
19+
*/
1620
class SearchCriteriaBuilderTest extends TestCase
1721
{
1822
public function testMake()

0 commit comments

Comments
 (0)