Skip to content

Commit 9d33487

Browse files
[Magento Community Engineering] Community Contributions - 2.4-develop-prs
- merged with '2.4-develop-fast-lane-prs' branch
2 parents 6d5d647 + c794828 commit 9d33487

6 files changed

+33
-41
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
</annotations>
1717

1818
<click stepKey="clickOnDoneButton" selector="{{AdminProductFormAdvancedInventorySection.doneButton}}"/>
19+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
1920
</actionGroup>
2021
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
<!-- Update product Advanced Inventory setting -->
4242
<click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/>
4343
<waitForPageLoad stepKey="waitForProductToLoad"/>
44-
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
45-
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
44+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
4645
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckConfigSetting"/>
4746
<selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="Yes" stepKey="clickOnManageStock"/>
4847
<fillField selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryQty}}" userInput="5" stepKey="fillProductQty"/>
@@ -53,9 +52,10 @@
5352
<selectOption selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" userInput="Yes" stepKey="selectQuatityUsesDecimal"/>
5453
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQtyConfigSetting}}" stepKey="uncheckNotifyBelowQtyheckBox"/>
5554
<fillField selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQty}}" userInput="1" stepKey="fillNotifyBelowQty"/>
56-
<selectOption selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryStockStatus}}" userInput="In Stock" stepKey="selectOutOfStock"/>
57-
<click stepKey="clickOnDoneButton" selector="{{AdminProductFormAdvancedInventorySection.doneButton}}"/>
58-
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
55+
<actionGroup ref="AdminSetStockStatusConfigActionGroup" stepKey="selectOutOfStock">
56+
<argument name="stockStatus" value="In Stock"/>
57+
</actionGroup>
58+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/>
5959
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/>
6060
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/>
6161
<!--Clear cache and reindex-->

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
<fillField selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" userInput="{{virtualProductWithoutManageStock.special_price}}" stepKey="fillSpecialPrice"/>
4141
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
4242
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{virtualProductWithoutManageStock.quantity}}" stepKey="fillProductQuantity"/>
43-
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickAdvancedInventoryLink"/>
43+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/>
4444
<click selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" stepKey="clickManageStock"/>
4545
<checkOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="CheckUseConfigSettingsCheckBox"/>
46-
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickDoneButtonOnAdvancedInventorySection"/>
46+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/>
4747
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
4848
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" />
4949
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@
5151
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="fillSimpleProductPrice"/>
5252
<selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="selectProductTaxClass"/>
5353
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="fillSimpleProductQuantity"/>
54-
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickAdvancedInventoryLink"/>
55-
<waitForPageLoad stepKey="waitForAdvancedInventoryPage"/>
54+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/>
5655
<conditionalClick selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" visible="true" stepKey="checkUseConfigSettingsCheckBox"/>
5756
<selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="selectManageStock"/>
58-
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickDoneButtonOnAdvancedInventorySection"/>
57+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/>
5958
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="selectStockStatusInStock"/>
6059
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="fillSimpleProductWeight"/>
6160
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="selectProductWeight"/>
@@ -92,8 +91,7 @@
9291
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPrice"/>
9392
<seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="seeProductTaxClass"/>
9493
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="seeSimpleProductQuantity"/>
95-
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickTheAdvancedInventoryLink"/>
96-
<waitForPageLoad stepKey="waitForAdvancedInventoryPageLoad"/>
94+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink"/>
9795
<see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="seeManageStock"/>
9896
<click selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="clickDoneButtonOnAdvancedInventory"/>
9997
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="seeSimpleProductStockStatus"/>

app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
stepKey="clickOpenProductForEdit"/>
3838
<waitForPageLoad time="30" stepKey="waitForProductEditOpen"/>
3939
<!--Step2. Open *Advanced Inventory* pop-up (Click on *Advanced Inventory* link). Set *Qty Uses Decimals* to *Yes*. Click on button *Done* -->
40-
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
40+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
4141
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" stepKey="scrollToQtyUsesDecimalsDropBox"/>
4242
<click selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" stepKey="clickOnQtyUsesDecimalsDropBox"/>
4343
<click selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimalsOptions('1')}}" stepKey="chooseYesOnQtyUsesDecimalsDropBox"/>
44-
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickOnDoneButton"/>
44+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/>
4545
<!--Step3. Open *Advanced Pricing* pop-up (Click on *Advanced Pricing* link). Click on *Add* button. Fill *0.5* in *Quantity*-->
4646
<scrollTo selector="{{AdminProductFormSection.productName}}" stepKey="scrollToProductName"/>
4747
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingLink1"/>
@@ -58,8 +58,7 @@
5858
<!--<click selector="{{AdminProductFormAdvancedPricingSection.advancedPricingCloseButton}}" stepKey="clickOnCloseButton"/>-->
5959

6060
<!--Step5. Open *Advanced Inventory* pop-up. Set *Enable Qty Increments* to *Yes*. Fill *.5* in *Qty Increments*-->
61-
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink2"/>
62-
<waitForPageLoad stepKey="waitForPageLoad"/>
61+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink2"/>
6362
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" stepKey="scrollToEnableQtyIncrements"/>
6463
<click selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrementsUseConfigSettings}}" stepKey="clickOnEnableQtyIncrementsUseConfigSettingsCheckbox"/>
6564
<click selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" stepKey="clickOnEnableQtyIncrements"/>
@@ -69,7 +68,7 @@
6968
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.qtyIncrements}}" stepKey="scrollToQtyIncrements"/>
7069
<fillField selector="{{AdminProductFormAdvancedInventorySection.qtyIncrements}}" userInput=".5" stepKey="fillQtyIncrements"/>
7170
<!--Step6. Close *Advanced Inventory* (Click on button *Done*). Save *prod1* (Click on button *Save*) -->
72-
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickOnDoneButton3"/>
71+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton3"/>
7372
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton2"/>
7473
<!--Step7. Open *Customer view* (Go to *Store Front*). Open *prod1* page (Find via search and click on product name) -->
7574
<amOnPage url="{{StorefrontHomePage.url}}$$createPreReqSimpleProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage"/>

lib/internal/Magento/Framework/App/ResourceConnection.php

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
2+
23
/**
34
* Copyright © Magento, Inc. All rights reserved.
45
* See COPYING.txt for license details.
56
*/
7+
declare(strict_types=1);
8+
69
namespace Magento\Framework\App;
710

811
use Magento\Framework\App\ResourceConnection\ConfigInterface as ResourceConfigInterface;
@@ -19,13 +22,10 @@
1922
*/
2023
class ResourceConnection
2124
{
22-
const AUTO_UPDATE_ONCE = 0;
23-
24-
const AUTO_UPDATE_NEVER = -1;
25-
26-
const AUTO_UPDATE_ALWAYS = 1;
27-
28-
const DEFAULT_CONNECTION = 'default';
25+
public const AUTO_UPDATE_ONCE = 0;
26+
public const AUTO_UPDATE_NEVER = -1;
27+
public const AUTO_UPDATE_ALWAYS = 1;
28+
public const DEFAULT_CONNECTION = 'default';
2929

3030
/**
3131
* Instances of actual connections.
@@ -94,8 +94,7 @@ public function __construct(
9494
public function getConnection($resourceName = self::DEFAULT_CONNECTION)
9595
{
9696
$connectionName = $this->config->getConnectionName($resourceName);
97-
$connection = $this->getConnectionByName($connectionName);
98-
return $connection;
97+
return $this->getConnectionByName($connectionName);
9998
}
10099

101100
/**
@@ -161,15 +160,15 @@ public function getConnectionByName($connectionName)
161160
*/
162161
private function getProcessConnectionName($connectionName)
163162
{
164-
return $connectionName . '_process_' . getmypid();
163+
return $connectionName . '_process_' . getmypid();
165164
}
166165

167166
/**
168167
* Get resource table name, validated by db adapter.
169168
*
170-
* @param string|string[] $modelEntity
169+
* @param string|string[] $modelEntity
171170
* @param string $connectionName
172-
* @return string
171+
* @return string
173172
* @api
174173
*/
175174
public function getTableName($modelEntity, $connectionName = self::DEFAULT_CONNECTION)
@@ -213,9 +212,9 @@ public function getTablePlaceholder($tableName)
213212
/**
214213
* Build a trigger name.
215214
*
216-
* @param string $tableName The table that is the subject of the trigger
217-
* @param string $time Either "before" or "after"
218-
* @param string $event The DB level event which activates the trigger, i.e. "update" or "insert"
215+
* @param string $tableName The table that is the subject of the trigger
216+
* @param string $time Either "before" or "after"
217+
* @param string $event The DB level event which activates the trigger, i.e. "update" or "insert"
219218
* @return string
220219
*/
221220
public function getTriggerName($tableName, $time, $event)
@@ -276,9 +275,9 @@ public function getIdxName(
276275
/**
277276
* Retrieve 32bit UNIQUE HASH for a Table foreign key.
278277
*
279-
* @param string $priTableName the target table name
278+
* @param string $priTableName the target table name
280279
* @param string $priColumnName the target table column name
281-
* @param string $refTableName the reference table name
280+
* @param string $refTableName the reference table name
282281
* @param string $refColumnName the reference table column name
283282
* @return string
284283
*/
@@ -304,10 +303,7 @@ public function getFkName($priTableName, $priColumnName, $refTableName, $refColu
304303
public function getSchemaName($resourceName)
305304
{
306305
return $this->deploymentConfig->get(
307-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTIONS .
308-
'/' .
309-
$resourceName .
310-
'/dbname'
306+
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTIONS . '/' . $resourceName . '/dbname'
311307
);
312308
}
313309

@@ -322,8 +318,6 @@ public function getTablePrefix()
322318
return $this->tablePrefix;
323319
}
324320

325-
return (string) $this->deploymentConfig->get(
326-
ConfigOptionsListConstants::CONFIG_PATH_DB_PREFIX
327-
);
321+
return (string)$this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_PREFIX);
328322
}
329323
}

0 commit comments

Comments
 (0)