Skip to content

Commit f98b3ab

Browse files
committed
MC-17533: 'Apply Coupon To Cart' benchmark scenario fix
1 parent fb2ac0b commit f98b3ab

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

setup/src/Magento/Setup/Test/Unit/Fixtures/CouponCodesFixtureTest.php

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -56,60 +56,20 @@ public function setUp()
5656
*/
5757
public function testExecute()
5858
{
59-
$storeMock = $this->createMock(\Magento\Store\Model\Store::class);
60-
$storeMock->expects($this->once())
61-
->method('getRootCategoryId')
62-
->will($this->returnValue(2));
63-
6459
$websiteMock = $this->createMock(\Magento\Store\Model\Website::class);
65-
$websiteMock->expects($this->once())
66-
->method('getGroups')
67-
->will($this->returnValue([$storeMock]));
6860
$websiteMock->expects($this->once())
6961
->method('getId')
7062
->will($this->returnValue('website_id'));
7163

72-
$contextMock = $this->createMock(\Magento\Framework\Model\ResourceModel\Db\Context::class);
73-
$abstractDbMock = $this->getMockForAbstractClass(
74-
\Magento\Framework\Model\ResourceModel\Db\AbstractDb::class,
75-
[$contextMock],
76-
'',
77-
true,
78-
true,
79-
true,
80-
['getAllChildren']
81-
);
82-
$abstractDbMock->expects($this->once())
83-
->method('getAllChildren')
84-
->will($this->returnValue([1]));
85-
8664
$storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManager::class);
8765
$storeManagerMock->expects($this->once())
8866
->method('getWebsites')
8967
->will($this->returnValue([$websiteMock]));
9068

91-
$categoryMock = $this->createMock(\Magento\Catalog\Model\Category::class);
92-
$categoryMock->expects($this->once())
93-
->method('getResource')
94-
->will($this->returnValue($abstractDbMock));
95-
$categoryMock->expects($this->once())
96-
->method('getPath')
97-
->will($this->returnValue('path/to/file'));
98-
$categoryMock->expects($this->once())
99-
->method('getId')
100-
->will($this->returnValue('category_id'));
101-
102-
$objectValueMap = [
103-
[\Magento\Catalog\Model\Category::class, $categoryMock]
104-
];
105-
10669
$objectManagerMock = $this->createMock(\Magento\Framework\ObjectManager\ObjectManager::class);
10770
$objectManagerMock->expects($this->once())
10871
->method('create')
10972
->will($this->returnValue($storeManagerMock));
110-
$objectManagerMock->expects($this->once())
111-
->method('get')
112-
->will($this->returnValueMap($objectValueMap));
11373

11474
$valueMap = [
11575
['coupon_codes', 0, 1]
@@ -120,7 +80,7 @@ public function testExecute()
12080
->method('getValue')
12181
->will($this->returnValueMap($valueMap));
12282
$this->fixtureModelMock
123-
->expects($this->exactly(2))
83+
->expects($this->exactly(1))
12484
->method('getObjectManager')
12585
->will($this->returnValue($objectManagerMock));
12686

0 commit comments

Comments
 (0)