Skip to content

Commit 277d542

Browse files
author
Valeriy Nayda
committed
GraphQL-165: GraphQL modules delivery
-- fix integration tests
1 parent bf98d4f commit 277d542

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

app/code/Magento/Quote/Model/QuoteManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function createEmptyCartForCustomer($customerId)
253253
} catch (\Exception $e) {
254254
throw new CouldNotSaveException(__("The quote can't be created."));
255255
}
256-
return $quote->getId();
256+
return (int)$quote->getId();
257257
}
258258

259259
/**

app/code/Magento/QuoteGraphQl/Model/Resolver/Cart/CreateEmptyCart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
7575
{
7676
$customerId = $this->userContext->getUserId();
7777

78-
if (null !== $customerId) {
78+
if (0 !== $customerId && null !== $customerId) {
7979
$quoteId = $this->cartManagement->createEmptyCartForCustomer($customerId);
8080
$maskedQuoteId = $this->quoteIdToMaskedId->execute($quoteId);
8181
} else {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
use Magento\Cms\Api\PageRepositoryInterface;
9+
use Magento\TestFramework\Helper\Bootstrap;
10+
11+
$objectManager = Bootstrap::getObjectManager();
12+
13+
/** @var PageRepositoryInterface $pageRepository */
14+
$pageRepository = $objectManager->get(PageRepositoryInterface::class);
15+
16+
$pageRepository->deleteById('page100');
17+
$pageRepository->deleteById('page_design_blank');

dev/tests/integration/testsuite/Magento/Store/_files/store.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@
2222
$store->save();
2323
} else {
2424
if ($store->getId()) {
25+
/** @var \Magento\TestFramework\Helper\Bootstrap $registry */
26+
$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
27+
\Magento\Framework\Registry::class
28+
);
29+
$registry->unregister('isSecureArea');
30+
$registry->register('isSecureArea', true);
31+
2532
$store->delete();
33+
34+
$registry->unregister('isSecureArea');
35+
$registry->register('isSecureArea', false);
36+
2637
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class);
2738
$store->setData(
2839
[

0 commit comments

Comments
 (0)