Skip to content

Commit 1748633

Browse files
committed
rename const with prefix "stub" move Object Manager to separate
variable
1 parent 74a244f commit 1748633

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

app/code/Magento/Wishlist/Test/Unit/Controller/Index/UpdateTest.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,9 @@
2929
*/
3030
class UpdateTest extends TestCase
3131
{
32-
/**
33-
* Wishlist item id
34-
*
35-
* @var int
36-
*/
37-
private const ITEM_ID = 1;
32+
private const STUB_ITEM_ID = 1;
3833

39-
/**
40-
* Product qty for wishlist
41-
*
42-
* @var int
43-
*/
44-
private const WISHLIST_PRODUCT_QTY = 21;
34+
private const STUB_WISHLIST_PRODUCT_QTY = 21;
4535

4636
/**
4737
* @var MockObject|Validator $formKeyValidatorMock
@@ -126,7 +116,9 @@ protected function setUp()
126116
->method('getMessageManager')
127117
->willReturn($this->messageManagerMock);
128118

129-
$this->updateController = (new ObjectManagerHelper($this))->getObject(
119+
$objectManager = new ObjectManagerHelper($this);
120+
121+
$this->updateController = $objectManager->getObject(
130122
Update::class,
131123
[
132124
'context' => $this->contextMock,
@@ -286,11 +278,11 @@ public function getWishlistDataProvider(): array
286278
[
287279
[
288280
[
289-
'id' => self::ITEM_ID
281+
'id' => self::STUB_ITEM_ID
290282
],
291283
[
292-
'qty' => [self::ITEM_ID => self::WISHLIST_PRODUCT_QTY],
293-
'description' => [self::ITEM_ID => 'Description for item_id 1']
284+
'qty' => [self::STUB_ITEM_ID => self::STUB_WISHLIST_PRODUCT_QTY],
285+
'description' => [self::STUB_ITEM_ID => 'Description for item_id 1']
294286
]
295287
]
296288
];

0 commit comments

Comments
 (0)