Skip to content

Commit 16d95fb

Browse files
ashishkumarpundeerashishkumarpundeer
authored andcommitted
AC-7550-V1::[2.4.5] Incorrect carrier/method code on selected shipping method in GraphQL
1 parent b5d9816 commit 16d95fb

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

app/code/Magento/QuoteGraphQl/Test/Unit/Model/Resolver/ShippingAddress/SelectedShippingMethodTest.php

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,52 +28,52 @@ class SelectedShippingMethodTest extends TestCase
2828
/**
2929
* @var SelectedShippingMethod
3030
*/
31-
private $selectedShippingMethod;
31+
private $selectedShippingMethod;
3232

3333
/**
3434
* @var ShippingMethodConverter|MockObject
3535
*/
36-
private $shippingMethodConverterMock;
36+
private $shippingMethodConverterMock;
3737

3838
/**
3939
* @var ScopeConfigInterface|MockObject
4040
*/
41-
private $scopeConfigMock;
41+
private $scopeConfigMock;
4242

4343
/**
4444
* @var Address|MockObject
4545
*/
46-
private $addressMock;
46+
private $addressMock;
4747

4848
/**
4949
* @var Rate|MockObject
5050
*/
51-
private $rateMock;
51+
private $rateMock;
5252

5353
/**
5454
* @var Field|MockObject
5555
*/
56-
private $fieldMock;
56+
private $fieldMock;
5757

5858
/**
5959
* @var ResolveInfo|MockObject
6060
*/
61-
private $resolveInfoMock;
61+
private $resolveInfoMock;
6262

6363
/**
6464
* @var Context|MockObject
6565
*/
66-
private $contextMock;
66+
private $contextMock;
6767

6868
/**
6969
* @var Quote|MockObject
7070
*/
71-
private $quoteMock;
71+
private $quoteMock;
7272

7373
/**
7474
* @var array
7575
*/
76-
private $valueMock = [];
76+
private $valueMock = [];
7777

7878
protected function setUp(): void
7979
{
@@ -98,7 +98,13 @@ protected function setUp(): void
9898
->getMock();
9999
$this->quoteMock = $this->getMockBuilder(Quote::class)
100100
->disableOriginalConstructor()
101-
->addMethods(['getQuoteCurrencyCode','getMethodTitle','getCarrierTitle','getPriceExclTax','getPriceInclTax'])
101+
->addMethods([
102+
'getQuoteCurrencyCode',
103+
'getMethodTitle',
104+
'getCarrierTitle',
105+
'getPriceExclTax',
106+
'getPriceInclTax'
107+
])
102108
->getMock();
103109
$this->selectedShippingMethod = new SelectedShippingMethod(
104110
$this->shippingMethodConverterMock
@@ -109,7 +115,12 @@ public function testResolveWithoutModelInValueParameter(): void
109115
{
110116
$this->expectException(LocalizedException::class);
111117
$this->expectExceptionMessage('"model" value should be specified');
112-
$this->selectedShippingMethod->resolve($this->fieldMock, $this->contextMock, $this->resolveInfoMock, $this->valueMock);
118+
$this->selectedShippingMethod->resolve(
119+
$this->fieldMock,
120+
$this->contextMock,
121+
$this->resolveInfoMock,
122+
$this->valueMock
123+
);
113124
}
114125

115126
public function testResolve(): void
@@ -159,7 +170,11 @@ public function testResolve(): void
159170
->willReturn($this->quoteMock);
160171
$this->shippingMethodConverterMock->method('modelToDataObject')
161172
->willReturn($this->quoteMock);
162-
$this->selectedShippingMethod->resolve($this->fieldMock, $this->contextMock, $this->resolveInfoMock, $this->valueMock);
173+
$this->selectedShippingMethod->resolve(
174+
$this->fieldMock,
175+
$this->contextMock,
176+
$this->resolveInfoMock,
177+
$this->valueMock
178+
);
163179
}
164-
165180
}

0 commit comments

Comments
 (0)