Skip to content

Commit c5f9423

Browse files
committed
Merge remote-tracking branch 'arcticfoxes/B2B-2217-gql' into B2B-2204
2 parents 407c348 + 2e392c8 commit c5f9423

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

app/code/Magento/Checkout/CustomerData/Cart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Cart extends \Magento\Framework\DataObject implements SectionSourceInterface
1717
{
1818
/**
19-
* @var \Magento\Customer\Model\Session
19+
* @var \Magento\Checkout\Model\Session
2020
*/
2121
protected $checkoutSession;
2222

app/code/Magento/CustomerGraphQl/etc/graphql/di.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
</argument>
2222
</arguments>
2323
</type>
24+
<type name="Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext">
25+
<arguments>
26+
<argument name="session" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument>
27+
</arguments>
28+
</type>
29+
<type name="Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest">
30+
<arguments>
31+
<argument name="session" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument>
32+
</arguments>
33+
</type>
2434
<type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider">
2535
<arguments>
2636
<argument name="extendedConfigData" xsi:type="array">

app/code/Magento/Downloadable/Controller/Download/Link.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ protected function _getCustomerSession()
3838
*/
3939
public function execute()
4040
{
41-
$session = $this->_getCustomerSession();
42-
4341
$id = $this->getRequest()->getParam('id', 0);
4442
/** @var PurchasedLink $linkPurchasedItem */
4543
$linkPurchasedItem = $this->_objectManager->create(
@@ -53,6 +51,7 @@ public function execute()
5351
return $this->_redirect('*/customer/products');
5452
}
5553
if (!$this->_objectManager->get(\Magento\Downloadable\Helper\Data::class)->getIsShareable($linkPurchasedItem)) {
54+
$session = $this->_getCustomerSession();
5655
$customerId = $session->getCustomerId();
5756
if (!$customerId) {
5857
/** @var \Magento\Catalog\Model\Product $product */

app/code/Magento/Downloadable/Test/Unit/Controller/Download/LinkTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ protected function setUp(): void
180180
*/
181181
public function testAbsentLinkId(): void
182182
{
183-
$this->objectManager->expects($this->once())
183+
$this->objectManager->expects($this->never())
184184
->method('get')
185185
->with(Session::class)
186186
->willReturn($this->session);
@@ -229,8 +229,8 @@ public function testGetLinkForGuestCustomer(): void
229229
$this->session->expects($this->once())->method('authenticate')->willReturn(true);
230230
$this->objectManager
231231
->method('get')
232-
->withConsecutive([Session::class], [Data::class])
233-
->willReturnOnConsecutiveCalls($this->session, $this->helperData);
232+
->withConsecutive([Data::class], [Session::class])
233+
->willReturnOnConsecutiveCalls($this->helperData, $this->session);
234234
$this->objectManager
235235
->method('create')
236236
->withConsecutive([Item::class], [Product::class], [UrlInterface::class])
@@ -262,8 +262,8 @@ public function testGetLinkForWrongCustomer(): void
262262
$this->session->expects($this->once())->method('getCustomerId')->willReturn('customer_id');
263263
$this->objectManager
264264
->method('get')
265-
->withConsecutive([Session::class], [Data::class])
266-
->willReturnOnConsecutiveCalls($this->session, $this->helperData);
265+
->withConsecutive([Data::class], [Session::class])
266+
->willReturnOnConsecutiveCalls($this->helperData, $this->session);
267267
$this->objectManager
268268
->method('create')
269269
->withConsecutive([Item::class], [Purchased::class])
@@ -295,8 +295,8 @@ public function testExceptionInUpdateLinkStatus($mimeType, $disposition): void
295295
->willReturnSelf();
296296
$this->objectManager
297297
->method('get')
298-
->withConsecutive([\Magento\Customer\Model\Session::class], [Data::class], [Download::class])
299-
->willReturnOnConsecutiveCalls($this->session, $this->helperData, $this->downloadHelper);
298+
->withConsecutive([Data::class], [Download::class])
299+
->willReturnOnConsecutiveCalls($this->helperData, $this->downloadHelper);
300300
$this->objectManager
301301
->method('create')
302302
->withConsecutive([Item::class])
@@ -383,8 +383,8 @@ public function testLinkNotAvailable($messageType, $status, $notice): void
383383
$this->linkPurchasedItem->expects($this->once())->method('getId')->willReturn(5);
384384
$this->objectManager
385385
->method('get')
386-
->withConsecutive([Session::class], [Data::class])
387-
->willReturnOnConsecutiveCalls($this->session, $this->helperData);
386+
->withConsecutive([Data::class], [Session::class])
387+
->willReturnOnConsecutiveCalls($this->helperData, $this->session);
388388
$this->objectManager
389389
->method('create')
390390
->with(Item::class)

app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class Cart
1414
{
1515
/**
16-
* @var \Magento\Customer\Model\Session
16+
* @var \Magento\Checkout\Model\Session
1717
*/
1818
protected $checkoutSession;
1919

app/code/Magento/Weee/Plugin/Checkout/CustomerData/Cart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class Cart extends \Magento\Tax\Plugin\Checkout\CustomerData\Cart
1010
{
1111
/**
12-
* @var \Magento\Customer\Model\Session
12+
* @var \Magento\Checkout\Model\Session
1313
*/
1414
protected $checkoutSession;
1515

0 commit comments

Comments
 (0)