Skip to content

Commit ac251bd

Browse files
[Magento Community Engineering] Community Contributions - 2.4-develop
- merged latest code from mainline branch
2 parents 19d1f93 + f13bfd7 commit ac251bd

File tree

70 files changed

+1426
-280
lines changed

Some content is hidden

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

70 files changed

+1426
-280
lines changed

app/code/Magento/Backend/Model/Widget/Grid/AbstractTotals.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected function _countExpr($expr, $collection)
117117
foreach ($parsedExpression as $operand) {
118118
if ($this->_parser->isOperation($operand)) {
119119
$this->_checkOperandsSet($firstOperand, $secondOperand, $tmpResult, $result);
120-
$result = $this->_operate($firstOperand, $secondOperand, $operand, $tmpResult, $result);
120+
$result = $this->_operate($firstOperand, $secondOperand, $operand);
121121
$firstOperand = $secondOperand = null;
122122
} else {
123123
if (null === $firstOperand) {
@@ -133,9 +133,9 @@ protected function _countExpr($expr, $collection)
133133
/**
134134
* Check if operands in not null and set operands values if they are empty
135135
*
136-
* @param float|int &$firstOperand
137-
* @param float|int &$secondOperand
138-
* @param float|int &$tmpResult
136+
* @param float|int $firstOperand
137+
* @param float|int $secondOperand
138+
* @param float|int $tmpResult
139139
* @param float|int $result
140140
* @return void
141141
*/

app/code/Magento/Backend/Test/Unit/Helper/DataTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ protected function setUp(): void
4242
$this->createMock(Auth::class),
4343
$this->_frontResolverMock,
4444
$this->createMock(Random::class),
45-
$this->getMockForAbstractClass(RequestInterface::class)
4645
);
4746
}
4847

app/code/Magento/Catalog/Block/Product/View/Details.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ class Details extends \Magento\Framework\View\Element\Template
2727
*
2828
* @return array
2929
* @since 103.0.1
30+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3031
*/
3132
public function getGroupSortedChildNames(string $groupName, string $callback): array
3233
{
33-
$groupChildNames = $this->getGroupChildNames($groupName, $callback);
34+
$groupChildNames = $this->getGroupChildNames($groupName);
3435
$layout = $this->getLayout();
3536

3637
$childNamesSortOrder = [];

app/code/Magento/Catalog/Model/ResourceModel/Category/Tree.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ class Tree extends Dbp
2424

2525
const LEVEL_FIELD = 'level';
2626

27+
/**
28+
* @var array
29+
*/
30+
private $_inactiveItems;
31+
2732
/**
2833
* @var \Magento\Framework\Event\ManagerInterface
2934
*/
@@ -290,7 +295,7 @@ protected function _getDisabledIds($collection, $allIds)
290295
foreach ($allIds as $id) {
291296
$parents = $this->getNodeById($id)->getPath();
292297
foreach ($parents as $parent) {
293-
if (!$this->_getItemIsActive($parent->getId(), $storeId)) {
298+
if (!$this->_getItemIsActive($parent->getId())) {
294299
$disabledIds[] = $id;
295300
continue;
296301
}
@@ -680,6 +685,8 @@ public function getExistingCategoryIdsBySpecifiedIds($ids)
680685
}
681686

682687
/**
688+
* Get entity methadata pool.
689+
*
683690
* @return \Magento\Framework\EntityManager\MetadataPool
684691
*/
685692
private function getMetadataPool()

app/code/Magento/Catalog/Model/ResourceModel/Product/Action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ protected function _saveAttributeValue($object, $attribute, $value)
160160
$storeId = (int) $this->_storeManager->getStore($object->getStoreId())->getId();
161161
$table = $attribute->getBackend()->getTable();
162162

163-
$entityId = $this->resolveEntityId($object->getId(), $table);
163+
$entityId = $this->resolveEntityId($object->getId());
164164

165165
/**
166166
* If we work in single store mode all values should be saved just

app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ class RepositoryTest extends TestCase
8383
*/
8484
protected $searchResultMock;
8585

86-
/**
87-
* @var AttributeOptionManagementInterface|MockObject
88-
*/
89-
private $optionManagementMock;
90-
9186
/**
9287
* @inheritdoc
9388
*/
@@ -116,8 +111,6 @@ protected function setUp(): void
116111
['getItems', 'getSearchCriteria', 'getTotalCount', 'setItems', 'setSearchCriteria', 'setTotalCount']
117112
)
118113
->getMockForAbstractClass();
119-
$this->optionManagementMock =
120-
$this->getMockForAbstractClass(ProductAttributeOptionManagementInterface::class);
121114

122115
$this->model = new Repository(
123116
$this->attributeResourceMock,
@@ -126,8 +119,7 @@ protected function setUp(): void
126119
$this->eavAttributeRepositoryMock,
127120
$this->eavConfigMock,
128121
$this->validatorFactoryMock,
129-
$this->searchCriteriaBuilderMock,
130-
$this->optionManagementMock
122+
$this->searchCriteriaBuilderMock
131123
);
132124
}
133125

@@ -291,7 +283,6 @@ public function testSaveDoesNotSaveAttributeOptionsIfOptionsAreAbsentInPayload()
291283
// Attribute code must not be changed after attribute creation
292284
$attributeMock->expects($this->once())->method('setAttributeCode')->with($attributeCode);
293285
$this->attributeResourceMock->expects($this->once())->method('save')->with($attributeMock);
294-
$this->optionManagementMock->expects($this->never())->method('add');
295286

296287
$this->model->save($attributeMock);
297288
}

app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/SelectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function setUp(): void
6666
];
6767
$configMock->expects($this->once())->method('getAll')->willReturn($config);
6868
$methods = ['getTitle', 'getType', 'getPriceType', 'getPrice', 'getData'];
69-
$this->valueMock = $this->createPartialMock(Option::class, $methods, []);
69+
$this->valueMock = $this->createPartialMock(Option::class, $methods);
7070
$this->validator = new Select(
7171
$configMock,
7272
$priceConfigMock,

app/code/Magento/Catalog/Test/Unit/Model/Product/Price/PricePersistenceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public function testDeleteWithException()
301301
->willReturn($idsBySku);
302302
$this->attributeRepository->expects($this->once())->method('get')->willReturn($this->productAttribute);
303303
$this->productAttribute->expects($this->once())->method('getAttributeId')->willReturn($attributeId);
304-
$this->attributeResource->expects($this->atLeastOnce(2))->method('getConnection')
304+
$this->attributeResource->expects($this->atLeastOnce())->method('getConnection')
305305
->willReturn($this->connection);
306306
$this->connection->expects($this->once())->method('beginTransaction')->willReturnSelf();
307307
$this->attributeResource

app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function validate(Observer $observer)
193193
$option->setHasError(true);
194194
//Setting this to false, so no error statuses are cleared
195195
$removeError = false;
196-
$this->addErrorInfoToQuote($result, $quoteItem, $removeError);
196+
$this->addErrorInfoToQuote($result, $quoteItem);
197197
}
198198
}
199199
if ($removeError) {

app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AfterProductLoadTest.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ class AfterProductLoadTest extends TestCase
3030
*/
3131
protected $productMock;
3232

33-
/**
34-
* @var ProductExtensionFactory|MockObject
35-
*/
36-
protected $productExtensionFactoryMock;
37-
3833
/**
3934
* @var ProductExtensionInterface|MockObject
4035
*/
@@ -43,16 +38,9 @@ class AfterProductLoadTest extends TestCase
4338
protected function setUp(): void
4439
{
4540
$stockRegistryMock = $this->getMockForAbstractClass(StockRegistryInterface::class);
46-
$this->productExtensionFactoryMock = $this->getMockBuilder(
47-
ProductExtensionFactory::class
48-
)
49-
->setMethods(['create'])
50-
->disableOriginalConstructor()
51-
->getMock();
5241

5342
$this->plugin = new AfterProductLoad(
54-
$stockRegistryMock,
55-
$this->productExtensionFactoryMock
43+
$stockRegistryMock
5644
);
5745

5846
$productId = 5494;
@@ -88,8 +76,6 @@ public function testAfterLoad()
8876
$this->productMock->expects($this->once())
8977
->method('getExtensionAttributes')
9078
->willReturn($this->productExtensionMock);
91-
$this->productExtensionFactoryMock->expects($this->never())
92-
->method('create');
9379

9480
$this->assertEquals(
9581
$this->productMock,

0 commit comments

Comments
 (0)