Skip to content

Commit ac4af31

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop
Accepted Community Pull Requests: - #25524: Fix issue #25517: Product item rating stars overlaps a hovered item on category page is� (by @speedy008) - #25519: [Instant Purchase] Unit test for CustomerData/InstantPurchase (by @edenduong) - #25485: fix for Issue #25434 Mail address email constructor argument type inc� (by @karyna-tsymbal-atwix) - #25424: Updated theme preview images (by @drpayyne) - #25436: Move Delete Website to after. Remove space around equal sign (by @TomashKhamlai) - #25456: added fix to ticket 25455 (by @Ashna-Jahan) - #25358: Fix magnifier image zoom and positioning regression (by @krzksz) - #25306: [Forward Port] #12205: Stock inventory reindex bug. (by @hostep) - #25302: Outuput for Exception in db-declaration:generate-whitelist command (by @GDauer) - #25504: [Instant Purchase] Cover Button block with Unit Test (by @edenduong) Fixed GitHub Issues: - #25517: Product item rating stars overlaps a hovered item on category page (reported by @tymzap) has been fixed in #25524 by @speedy008 in 2.3-develop branch Related commits: 1. e891e81 - #25434: Mail address email constructor argument type incorrect (reported by @DuckThom) has been fixed in #25485 by @karyna-tsymbal-atwix in 2.3-develop branch Related commits: 1. 2868403 2. bd44b0b 3. d40fbd9 - #25027: Fotorama Magnifier not correct since 2.3.3 (reported by @gwharton) has been fixed in #25358 by @krzksz in 2.3-develop branch Related commits: 1. 420ff66 - #12205: Stock inventory reindex bug (reported by @Nix-id) has been fixed in #25306 by @hostep in 2.3-develop branch Related commits: 1. c6d166b - #15984: Random products show out of stock until manual reindex (reported by @AF4Q) has been fixed in #25306 by @hostep in 2.3-develop branch Related commits: 1. c6d166b
2 parents 54742d5 + 97d820f commit ac4af31

File tree

22 files changed

+553
-36
lines changed

22 files changed

+553
-36
lines changed

app/code/Magento/Backup/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<label>Backup Settings</label>
1313
<field id="functionality_enabled" translate="label" type="select" sortOrder="5" showInDefault="1" showInWebsite="0" showInStore="0">
1414
<label>Enable Backup</label>
15-
<comment>Disabled by default for security reasons</comment>
15+
<comment>Disabled by default for security reasons.</comment>
1616
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1717
</field>
1818
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
<!-- Delete the simple product -->
3333
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
3434

35+
<!-- Delete a Website -->
36+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
37+
<argument name="websiteName" value="Second Website"/>
38+
</actionGroup>
39+
3540
<!-- Log out -->
3641
<actionGroup ref="logout" stepKey="logout"/>
3742
</after>
@@ -135,11 +140,6 @@
135140
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
136141
<argument name="product" value="BundleProduct"/>
137142
</actionGroup>
138-
139-
<!-- Delete created Website -->
140-
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
141-
<argument name="websiteName" value="$createWebsite.website[name]$"/>
142-
</actionGroup>
143143
</test>
144144
<test name="AdminCreateAndEditBundleProductOptionsNegativeTest">
145145
<annotations>

app/code/Magento/Catalog/etc/adminhtml/system.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</field>
6666
<field id="grid_per_page" translate="label comment" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
6767
<label>Products per Page on Grid Default Value</label>
68-
<comment>Must be in the allowed values list</comment>
68+
<comment>Must be in the allowed values list.</comment>
6969
<validate>validate-per-page-value</validate>
7070
</field>
7171
<field id="list_per_page_values" translate="label comment" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
@@ -75,7 +75,7 @@
7575
</field>
7676
<field id="list_per_page" translate="label comment" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
7777
<label>Products per Page on List Default Value</label>
78-
<comment>Must be in the allowed values list</comment>
78+
<comment>Must be in the allowed values list.</comment>
7979
<validate>validate-per-page-value</validate>
8080
</field>
8181
<field id="flat_catalog_category" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
@@ -90,12 +90,12 @@
9090
</field>
9191
<field id="default_sort_by" translate="label comment" type="select" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
9292
<label>Product Listing Sort by</label>
93-
<comment>Applies to category pages</comment>
93+
<comment>Applies to category pages.</comment>
9494
<source_model>Magento\Catalog\Model\Config\Source\ListSort</source_model>
9595
</field>
9696
<field id="list_allow_all" translate="label comment" type="select" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1">
9797
<label>Allow All Products per Page</label>
98-
<comment>Whether to show "All" option in the "Show X Per Page" dropdown</comment>
98+
<comment>Whether to show "All" option in the "Show X Per Page" dropdown.</comment>
9999
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
100100
</field>
101101
<field id="remember_pagination" translate="label comment" type="select" sortOrder="7" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">

app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ protected function _prepareIndexTable($entityIds = null)
292292
*/
293293
protected function _updateIndex($entityIds)
294294
{
295+
$this->deleteOldRecords($entityIds);
295296
$connection = $this->getConnection();
296297
$select = $this->_getStockStatusSelect($entityIds, true);
297298
$select = $this->getQueryProcessorComposite()->processQuery($select, $entityIds, true);
@@ -314,7 +315,6 @@ protected function _updateIndex($entityIds)
314315
}
315316
}
316317

317-
$this->deleteOldRecords($entityIds);
318318
$this->_updateIndexTable($data);
319319

320320
return $this;

app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Developer\Model\Setup\Declaration\Schema\WhitelistGenerator;
1111
use Magento\Framework\Config\FileResolverByModule;
1212
use Magento\Framework\Exception\ConfigurationMismatchException;
13+
use Magento\Framework\Console\Cli;
1314
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Input\InputInterface;
1516
use Symfony\Component\Console\Input\InputOption;
@@ -80,11 +81,12 @@ protected function execute(InputInterface $input, OutputInterface $output) : int
8081
$this->whitelistGenerator->generate($moduleName);
8182
} catch (ConfigurationMismatchException $e) {
8283
$output->writeln($e->getMessage());
83-
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
84+
return Cli::RETURN_FAILURE;
8485
} catch (\Exception $e) {
85-
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
86+
$output->writeln($e->getMessage());
87+
return Cli::RETURN_FAILURE;
8688
}
8789

88-
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
90+
return Cli::RETURN_SUCCESS;
8991
}
9092
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
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+
namespace Magento\Developer\Test\Unit\Console\Command;
9+
10+
use Magento\Developer\Console\Command\TablesWhitelistGenerateCommand as GenerateCommand;
11+
use Magento\Developer\Model\Setup\Declaration\Schema\WhitelistGenerator;
12+
use Magento\Framework\Console\Cli;
13+
use Magento\Framework\Exception\ConfigurationMismatchException as ConfigException;
14+
use PHPUnit\Framework\MockObject\MockObject;
15+
use PHPUnit\Framework\TestCase;
16+
use Symfony\Component\Console\Tester\CommandTester;
17+
18+
/**
19+
* Class TablesWhitelistGenerateCommandTest
20+
*
21+
* @package Magento\Developer\Test\Unit\Console\Command
22+
*/
23+
class TablesWhitelistGenerateCommandTest extends TestCase
24+
{
25+
// Exception Messages!
26+
const CONFIG_EXCEPTION_MESSAGE = 'Configuration Exception Message';
27+
const EXCEPTION_MESSAGE = 'General Exception Message';
28+
29+
/** @var WhitelistGenerator|MockObject $whitelistGenerator */
30+
private $whitelistGenerator;
31+
32+
/** @var GenerateCommand $instance */
33+
private $instance;
34+
35+
protected function setUp()
36+
{
37+
$this->whitelistGenerator = $this->getMockBuilder(WhitelistGenerator::class)
38+
->disableOriginalConstructor()
39+
->getMock();
40+
41+
$this->instance = new GenerateCommand($this->whitelistGenerator);
42+
}
43+
44+
/**
45+
* Test case for success scenario
46+
*
47+
* @param string $arguments
48+
* @param string $expected
49+
*
50+
* @dataProvider successDataProvider
51+
*/
52+
public function testCommandSuccess(string $arguments, string $expected)
53+
{
54+
$this->whitelistGenerator->expects($this->once())
55+
->method('generate')
56+
->with($arguments);
57+
58+
$commandTest = $this->execute($arguments);
59+
$this->assertEquals($expected, $commandTest->getStatusCode());
60+
$this->assertEquals('', $commandTest->getDisplay());
61+
}
62+
63+
/**
64+
* Test case for failure scenario
65+
*
66+
* @param string $arguments
67+
* @param string $expected
68+
* @param \Exception|ConfigException $exception
69+
* @param string $output
70+
*
71+
* @dataProvider failureDataProvider
72+
*/
73+
public function testCommandFailure(string $arguments, string $expected, $exception, string $output)
74+
{
75+
$this->whitelistGenerator->expects($this->once())
76+
->method('generate')
77+
->with($arguments)
78+
->willReturnCallback(
79+
function () use ($exception) {
80+
throw $exception;
81+
}
82+
);
83+
84+
$commandTest = $this->execute($arguments);
85+
$this->assertEquals($expected, $commandTest->getStatusCode());
86+
$this->assertEquals($output . PHP_EOL, $commandTest->getDisplay());
87+
}
88+
89+
/**
90+
* Data provider for success test case
91+
*
92+
* @return array
93+
*/
94+
public function successDataProvider()
95+
{
96+
return [
97+
[
98+
'all',
99+
Cli::RETURN_SUCCESS,
100+
101+
],
102+
[
103+
'Module_Name',
104+
Cli::RETURN_SUCCESS
105+
]
106+
];
107+
}
108+
109+
/**
110+
* Data provider for failure test case
111+
*
112+
* @return array
113+
*/
114+
public function failureDataProvider()
115+
{
116+
return [
117+
[
118+
'all',
119+
Cli::RETURN_FAILURE,
120+
new ConfigException(__('Configuration Exception Message')),
121+
self::CONFIG_EXCEPTION_MESSAGE
122+
],
123+
[
124+
'Module_Name',
125+
Cli::RETURN_FAILURE,
126+
new ConfigException(__('Configuration Exception Message')),
127+
self::CONFIG_EXCEPTION_MESSAGE
128+
],
129+
[
130+
'all',
131+
Cli::RETURN_FAILURE,
132+
new \Exception(self::EXCEPTION_MESSAGE),
133+
self::EXCEPTION_MESSAGE
134+
],
135+
[
136+
'Module_Name',
137+
Cli::RETURN_FAILURE,
138+
new \Exception(self::EXCEPTION_MESSAGE),
139+
self::EXCEPTION_MESSAGE
140+
]
141+
];
142+
}
143+
144+
/**
145+
* Execute command test class for symphony
146+
*
147+
* @param string $arguments
148+
*
149+
* @return CommandTester
150+
*/
151+
private function execute(string $arguments)
152+
{
153+
$commandTest = new CommandTester($this->instance);
154+
$commandTest->execute(['--' . GenerateCommand::MODULE_NAME_KEY => $arguments]);
155+
156+
return $commandTest;
157+
}
158+
}

app/code/Magento/Developer/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<label>Frontend Development Workflow</label>
1212
<field id="type" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
1313
<label>Workflow type</label>
14-
<comment>Not available in production mode</comment>
14+
<comment>Not available in production mode.</comment>
1515
<source_model>Magento\Developer\Model\Config\Source\WorkflowType</source_model>
1616
<frontend_model>Magento\Developer\Block\Adminhtml\System\Config\WorkflowType</frontend_model>
1717
<backend_model>Magento\Developer\Model\Config\Backend\WorkflowType</backend_model>

app/code/Magento/Dhl/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
</field>
8989
<field id="ready_time" translate="label comment" type="text" sortOrder="180" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
9090
<label>Ready time</label>
91-
<comment>Package ready time after order submission (in hours)</comment>
91+
<comment>Package ready time after order submission (in hours).</comment>
9292
</field>
9393
<field id="specificerrmsg" translate="label" type="textarea" sortOrder="800" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
9494
<label>Displayed Error Message</label>

0 commit comments

Comments
 (0)