Skip to content

Commit fe95cca

Browse files
[Magento Community Engineering] Community Contributions - 2.4-develop-expedited-prs
- merged with '2.4-develop-prs' branch
2 parents d159aca + 85716b7 commit fe95cca

File tree

5 files changed

+70
-11
lines changed

5 files changed

+70
-11
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,40 @@ public function testRemoveItemFromAnotherCustomerCart()
155155
$this->graphQlMutation($query, [], '', $this->getHeaderMap('customer2@search.example.com'));
156156
}
157157

158+
/**
159+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
160+
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
161+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
162+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
163+
*/
164+
public function testRemoveItemWithEmptyCartId()
165+
{
166+
$cartId = "";
167+
$cartItemId = $this->getQuoteItemIdByReservedQuoteIdAndSku->execute('test_quote', 'simple_product');
168+
169+
$this->expectExceptionMessage("Required parameter \"cart_id\" is missing.");
170+
171+
$query = $this->getQuery($cartId, $cartItemId);
172+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
173+
}
174+
175+
/**
176+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
177+
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
178+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
179+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
180+
*/
181+
public function testRemoveItemWithZeroCartItemId()
182+
{
183+
$cartId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
184+
$cartItemId = 0;
185+
186+
$this->expectExceptionMessage("Required parameter \"cart_item_id\" is missing.");
187+
188+
$query = $this->getQuery($cartId, $cartItemId);
189+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
190+
}
191+
158192
/**
159193
* @param string $maskedQuoteId
160194
* @param int $itemId

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,38 @@ public function testRemoveItemFromCustomerCart()
119119
$this->graphQlMutation($query);
120120
}
121121

122+
/**
123+
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
124+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
125+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
126+
*/
127+
public function testRemoveItemWithEmptyCartId()
128+
{
129+
$cartId = "";
130+
$cartItemId = $this->getQuoteItemIdByReservedQuoteIdAndSku->execute('test_quote', 'simple_product');
131+
132+
$this->expectExceptionMessage("Required parameter \"cart_id\" is missing.");
133+
134+
$query = $this->getQuery($cartId, $cartItemId);
135+
$this->graphQlMutation($query);
136+
}
137+
138+
/**
139+
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
140+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
141+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
142+
*/
143+
public function testRemoveItemWithZeroCartItemId()
144+
{
145+
$cartId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
146+
$cartItemId = 0;
147+
148+
$this->expectExceptionMessage("Required parameter \"cart_item_id\" is missing.");
149+
150+
$query = $this->getQuery($cartId, $cartItemId);
151+
$this->graphQlMutation($query);
152+
}
153+
122154
/**
123155
* @param string $maskedQuoteId
124156
* @param int $itemId

lib/internal/Magento/Framework/Component/ComponentRegistrar.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
/**
99
* Provides ability to statically register components.
1010
*
11-
* @author Josh Di Fabio <joshdifabio@gmail.com>
12-
*
1311
* @api
1412
*/
1513
class ComponentRegistrar implements ComponentRegistrarInterface
@@ -50,13 +48,12 @@ public static function register($type, $componentName, $path)
5048
ucfirst($type) . ' \'' . $componentName . '\' from \'' . $path . '\' '
5149
. 'has been already defined in \'' . self::$paths[$type][$componentName] . '\'.'
5250
);
53-
} else {
54-
self::$paths[$type][$componentName] = str_replace('\\', '/', $path);
5551
}
52+
self::$paths[$type][$componentName] = str_replace('\\', '/', $path);
5653
}
5754

5855
/**
59-
* {@inheritdoc}
56+
* @inheritdoc
6057
*/
6158
public function getPaths($type)
6259
{
@@ -65,7 +62,7 @@ public function getPaths($type)
6562
}
6663

6764
/**
68-
* {@inheritdoc}
65+
* @inheritdoc
6966
*/
7067
public function getPath($type, $componentName)
7168
{

lib/internal/Magento/Framework/Component/ComponentRegistrarInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
*/
66
namespace Magento\Framework\Component;
77

8-
/**
9-
* @author Josh Di Fabio <joshdifabio@gmail.com>
10-
*/
118
interface ComponentRegistrarInterface
129
{
1310
/**

lib/internal/Magento/Framework/Module/ModuleList/Loader.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ public function load(array $exclude = [])
111111
* </code>
112112
*
113113
* @return \Traversable
114-
*
115-
* @author Josh Di Fabio <joshdifabio@gmail.com>
114+
* @throws \Magento\Framework\Exception\FileSystemException
116115
*/
117116
private function getModuleConfigs()
118117
{

0 commit comments

Comments
 (0)