Skip to content

Commit d2494db

Browse files
author
Prabhu Ram
committed
Merge remote-tracking branch 'mainline/2.4-develop' into m2-routable-interface-graphqL
2 parents 0cced6c + 592c792 commit d2494db

File tree

123 files changed

+5030
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+5030
-356
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,21 @@ public function assertFileExists($filePath, $message = ''): void
149149
$this->assertTrue($this->driver->isExists($filePath), $message);
150150
}
151151

152+
/**
153+
* Asserts that a file with the given glob pattern exists in the given path on the remote storage system
154+
*
155+
* @param string $path
156+
* @param string $pattern
157+
* @param string $message
158+
*
159+
* @throws \Magento\Framework\Exception\FileSystemException
160+
*/
161+
public function assertGlobbedFileExists($path, $pattern, $message = ""): void
162+
{
163+
$files = $this->driver->search($pattern, $path);
164+
$this->assertNotEmpty($files, $message);
165+
}
166+
152167
/**
153168
* Assert a file does not exist on the remote storage system
154169
*
@@ -206,6 +221,24 @@ public function assertFileContainsString($filePath, $text, $message = ""): void
206221
$this->assertStringContainsString($text, $this->driver->fileGetContents($filePath), $message);
207222
}
208223

224+
/**
225+
* Asserts that a file with the given glob pattern at the given path on the remote storage system contains a given string
226+
*
227+
* @param string $path
228+
* @param string $pattern
229+
* @param string $text
230+
* @param int $fileIndex
231+
* @param string $message
232+
* @return void
233+
*
234+
* @throws \Magento\Framework\Exception\FileSystemException
235+
*/
236+
public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void
237+
{
238+
$files = $this->driver->search($pattern, $path);
239+
$this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message);
240+
}
241+
209242
/**
210243
* Assert a file on the remote storage system does not contain a given string
211244
*

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
273273
['cwd' => $this->getTable('catalog_product_index_website')],
274274
'pw.website_id = cwd.website_id',
275275
[]
276+
)->joinLeft(
277+
['cgw' => $this->getTable('customer_group_excluded_website')],
278+
'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id',
279+
[]
276280
);
277281
$select->joinLeft(
278282
['tp' => $this->getTable('catalog_product_index_tier_price')],
@@ -365,6 +369,9 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
365369
$select->where('e.entity_id IN(?)', $entityIds);
366370
}
367371

372+
// exclude websites that are limited for customer group
373+
$select->where('cgw.website_id IS NULL');
374+
368375
/**
369376
* Add additional external limitation
370377
*/
@@ -714,6 +721,11 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
714721
['pw' => $this->getTable('store_website')],
715722
'tp.website_id = 0 OR tp.website_id = pw.website_id',
716723
['website_id']
724+
)->joinLeft(
725+
// customer group website limitations
726+
['cgw' => $this->getTable('customer_group_excluded_website')],
727+
'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id',
728+
[]
717729
)->where(
718730
'pw.website_id != 0'
719731
)->where(
@@ -728,6 +740,10 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
728740
if (!empty($entityIds)) {
729741
$select->where('e.entity_id IN(?)', $entityIds);
730742
}
743+
744+
// exclude websites that are limited for customer group
745+
$select->where('cgw.website_id IS NULL');
746+
731747
foreach ($dimensions as $dimension) {
732748
if (!isset($this->dimensionToFieldMapper[$dimension->getName()])) {
733749
throw new \LogicException(

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</createData>
4242

4343
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
44-
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
44+
<argument name="indices" value=""/>
4545
</actionGroup>
4646
</before>
4747
<after>

app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public function getCurrentProductData()
153153
$this->productRenderCollectorComposite
154154
->collect($product, $productRender);
155155
$data = $this->hydrator->extract($productRender);
156+
$data['is_available'] = $product->isAvailable();
156157

157158
$currentProductData = [
158159
'items' => [

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ public function getQuery(array $dimensions, string $productType, array $entityId
128128
['cwd' => $this->getTable('catalog_product_index_website')],
129129
'pw.website_id = cwd.website_id',
130130
[]
131+
)->joinLeft(
132+
// customer group website limitations
133+
['cgw' => $this->getTable('customer_group_excluded_website')],
134+
'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id',
135+
[]
131136
)->joinLeft(
132137
// we need this only for BCC in case someone expects table `tp` to be present in query
133138
['tp' => $this->getTable('catalog_product_index_tier_price')],
@@ -227,6 +232,9 @@ public function getQuery(array $dimensions, string $productType, array $entityId
227232
$select->where('e.entity_id IN(?)', $entityIds);
228233
}
229234

235+
// exclude websites that are limited for customer group
236+
$select->where('cgw.website_id IS NULL');
237+
230238
/**
231239
* throw event for backward compatibility
232240
*/

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717

1818
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
1919
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
20+
<!-- Wait for close button appeared. That means animation finished and modal window is fully visible -->
21+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/>
2022
</actionGroup>
2123
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<data key="name">TestFooBar</data>
4040
<data key="sku" unique="suffix">foobar</data>
4141
</entity>
42+
<entity name="ApiSimpleProductWithDoubleSpaces" type="product" extends="ApiSimpleProduct">
43+
<data key="name">Simple Product Double Space</data>
44+
<data key="sku" unique="suffix">simple-product double-space</data>
45+
</entity>
4246
<entity name="ApiSimpleProductWithSpecCharInName" type="product" extends="ApiSimpleProduct">
4347
<data key="name">Pursuit Lumaflex&#38;trade; Tone Band</data>
4448
<data key="sku" unique="suffix">x&#38;trade;</data>
@@ -1392,9 +1396,34 @@
13921396
<entity name="SimpleProductUpdatePrice16" type="product2">
13931397
<data key="price">16.00</data>
13941398
</entity>
1399+
<entity name="SimpleProductUpdatePrice90" type="product2">
1400+
<data key="price">90.00</data>
1401+
</entity>
1402+
<entity name="SimpleProductUpdatePrice95" type="product2">
1403+
<data key="price">95.00</data>
1404+
</entity>
1405+
<entity name="SimpleProductUpdatePrice80" type="product2">
1406+
<data key="price">80.00</data>
1407+
</entity>
13951408
<entity name="ProductWithTwoTextFieldOptions" type="product">
13961409
<var key="sku" entityType="product" entityKey="sku" />
13971410
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
13981411
<requiredEntity type="product_option">ProductOptionField2</requiredEntity>
13991412
</entity>
1413+
<entity name="SimpleProductWithCustomSku24MB01" type="product" extends="SimpleProduct2">
1414+
<data key="name" unique="suffix">ProductWithSku24MB01-</data>
1415+
<data key="sku" unique="suffix">24 MB01</data>
1416+
</entity>
1417+
<entity name="SimpleProductWithCustomSku24MB02" type="product" extends="SimpleProduct2">
1418+
<data key="name" unique="suffix">ProductWithSku24MB02-</data>
1419+
<data key="sku" unique="suffix">24 MB02 </data>
1420+
</entity>
1421+
<entity name="SimpleProductWithCustomSku24MB04" type="product" extends="SimpleProduct2">
1422+
<data key="name" unique="suffix">ProductWithSku24MB04-</data>
1423+
<data key="sku" unique="suffix">24 MB04 </data>
1424+
</entity>
1425+
<entity name="SimpleProductWithCustomSku24MB06" type="product" extends="SimpleProduct2">
1426+
<data key="name" unique="suffix">ProductWithSku24MB06-</data>
1427+
<data key="sku" unique="suffix">24 MB06 </data>
1428+
</entity>
14001429
</entities>

app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ public function assertFileExists($filePath, $message = ''): void
134134
$this->assertTrue($this->driver->isExists($realPath), $message);
135135
}
136136

137+
/**
138+
* Asserts that a file with the given glob pattern exists in the given path
139+
*
140+
* @param string $path
141+
* @param string $pattern
142+
* @param string $message
143+
*
144+
* @throws \Magento\Framework\Exception\FileSystemException
145+
*/
146+
public function assertGlobbedFileExists($path, $pattern, $message = ""): void
147+
{
148+
$realPath = $this->expandPath($path);
149+
$files = $this->driver->search($pattern, $realPath);
150+
$this->assertNotEmpty($files, $message);
151+
}
152+
137153
/**
138154
* Assert a file does not exist
139155
*
@@ -195,6 +211,25 @@ public function assertFileContainsString($filePath, $text, $message = ""): void
195211
$this->assertStringContainsString($text, $this->driver->fileGetContents($realPath), $message);
196212
}
197213

214+
/**
215+
* Asserts that a file with the given glob pattern at the given path contains a given string
216+
*
217+
* @param string $path
218+
* @param string $pattern
219+
* @param string $text
220+
* @param int $fileIndex
221+
* @param string $message
222+
* @return void
223+
*
224+
* @throws \Magento\Framework\Exception\FileSystemException
225+
*/
226+
public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void
227+
{
228+
$realPath = $this->expandPath($path);
229+
$files = $this->driver->search($pattern, $realPath);
230+
$this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message);
231+
}
232+
198233
/**
199234
* Assert a file does not contain a given string
200235
*
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminShowDoubleSpacesInProductGrid">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Edit products"/>
14+
<title value="Show double spaces in the product grid"/>
15+
<description value="Admin should be able to see double spaces in the Name and Sku fields in the product grid"/>
16+
<testCaseId value="MC-40725"/>
17+
<useCaseId value="MC-40122"/>
18+
<severity value="AVERAGE"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
<createData entity="ApiSimpleProductWithDoubleSpaces" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<magentoCLI command="cron:run --group=index" stepKey="cronRun"/>
28+
<magentoCLI command="cron:run --group=index" stepKey="cronRunSecondTime"/>
29+
</before>
30+
31+
<after>
32+
<actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="deleteProduct"/>
33+
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearGridFilters"/>
34+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
35+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
36+
</after>
37+
38+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
39+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
40+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="searchForProduct">
41+
<argument name="product" value="$createProduct$"/>
42+
</actionGroup>
43+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductName">
44+
<argument name="column" value="Name"/>
45+
<argument name="value" value="$createProduct.name$"/>
46+
</actionGroup>
47+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductSku">
48+
<argument name="column" value="SKU"/>
49+
<argument name="value" value="$createProduct.sku$"/>
50+
</actionGroup>
51+
</test>
52+
</tests>

app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ public function testGetCurrentProductDataWithNonEmptyProduct()
166166
{
167167
$productMock = $this->getMockBuilder(ProductInterface::class)
168168
->disableOriginalConstructor()
169+
->addMethods(['isAvailable'])
169170
->getMockForAbstractClass();
170171
$productRendererMock = $this->getMockBuilder(ProductRenderInterface::class)
171172
->disableOriginalConstructor()
172173
->getMockForAbstractClass();
173174
$storeMock = $this->getMockBuilder(Store::class)
174175
->disableOriginalConstructor()
175176
->getMock();
176-
177177
$this->registryMock->expects($this->once())
178178
->method('registry')
179179
->with('product')

0 commit comments

Comments
 (0)