Skip to content

Commit d1190ce

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #21576: [Backport] Fix for issue #21510: Can't access backend indexers page after creating a custom index (by @ccasciotti) - #21661: [backport] Improve swatch table overflow handling (by @Cyanoxide) - #21845: [Backport] #12396: Total Amount cart rule without tax (by @eduard13) - #21543: [BP] static tests forbid or instead of 21062 (by @novikor) Fixed GitHub Issues: - #21510: Can't access backend indexers page after creating a custom index (reported by @ccasciotti) has been fixed in #21576 by @ccasciotti in 2.2-develop branch Related commits: 1. 2c956f6 2. d5ed9e8 - #12396: "Total Amount" cart rule without tax (reported by @Chei20) has been fixed in #21845 by @eduard13 in 2.2-develop branch Related commits: 1. 9529d31 2. 362bbf2 3. a5608f0 - #21062: Static tests: forbid 'or' instead of '||' (reported by @novikor) has been fixed in #21543 by @novikor in 2.2-develop branch Related commits: 1. 9f0ef59
2 parents 81d0497 + a65bc16 commit d1190ce

File tree

10 files changed

+67
-14
lines changed

10 files changed

+67
-14
lines changed

app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function testBuild()
111111
* @expectedException \Magento\Payment\Gateway\Command\CommandException
112112
* @expectedExceptionMessage The Payment Token is not available to perform the request.
113113
*/
114-
public function testBuildWithoutPaymentToken(): void
114+
public function testBuildWithoutPaymentToken()
115115
{
116116
$amount = 30.00;
117117
$buildSubject = [

app/code/Magento/Indexer/Model/Indexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public function getLatestUpdated()
361361
return $this->getView()->getUpdated();
362362
}
363363
}
364-
return $this->getState()->getUpdated();
364+
return $this->getState()->getUpdated() ?: '';
365365
}
366366

367367
/**

app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ public function testGetLatestUpdated($getViewIsEnabled, $getViewGetUpdated, $get
164164
}
165165
}
166166
} else {
167-
$this->assertEquals($getStateGetUpdated, $this->model->getLatestUpdated());
167+
$getLatestUpdated = $this->model->getLatestUpdated();
168+
$this->assertEquals($getStateGetUpdated, $getLatestUpdated);
169+
170+
if ($getStateGetUpdated === null) {
171+
$this->assertNotNull($getLatestUpdated);
172+
}
168173
}
169174
}
170175

@@ -182,7 +187,8 @@ public function getLatestUpdatedDataProvider()
182187
[true, '', '06-Jan-1944'],
183188
[true, '06-Jan-1944', ''],
184189
[true, '', ''],
185-
[true, '06-Jan-1944', '05-Jan-1944']
190+
[true, '06-Jan-1944', '05-Jan-1944'],
191+
[false, null, null],
186192
];
187193
}
188194

app/code/Magento/SalesRule/Model/Rule/Condition/Address.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function __construct(
5858
public function loadAttributeOptions()
5959
{
6060
$attributes = [
61+
'base_subtotal_with_discount' => __('Subtotal (Excl. Tax)'),
6162
'base_subtotal' => __('Subtotal'),
6263
'total_qty' => __('Total Items Quantity'),
6364
'weight' => __('Total Weight'),

app/code/Magento/Swatches/view/adminhtml/web/css/swatches.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,19 @@
150150
}
151151

152152
.col-swatch-min-width {
153-
min-width: 30px;
153+
min-width: 65px;
154+
}
155+
156+
[class^=swatch-col],
157+
[class^=col-]:not(.col-draggable):not(.col-default) {
158+
min-width: 150px;
159+
}
160+
161+
#swatch-visual-options-panel,
162+
#swatch-text-options-panel,
163+
#manage-options-panel {
164+
overflow: auto;
165+
width: 100%;
154166
}
155167

156168
.swatches-visual-col.unavailable:after {

dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ class ConditionsElement extends SimpleElement
195195
*/
196196
protected $exception;
197197

198+
/**
199+
* Condition option text selector.
200+
*
201+
* @var string
202+
*/
203+
private $conditionOptionTextSelector = '//option[normalize-space(text())="%s"]';
204+
198205
/**
199206
* @inheritdoc
200207
*/
@@ -282,10 +289,16 @@ protected function addCondition($type, ElementInterface $context)
282289
$count = 0;
283290

284291
do {
285-
$newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click();
286-
287292
try {
288-
$newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select')->setValue($type);
293+
$specificType = $newCondition->find(
294+
sprintf($this->conditionOptionTextSelector, $type),
295+
Locator::SELECTOR_XPATH
296+
)->isPresent();
297+
$newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click();
298+
$condition = $specificType
299+
? $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'selectcondition')
300+
: $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select');
301+
$condition->setValue($type);
289302
$isSetType = true;
290303
} catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
291304
$isSetType = false;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Mtf\Client\Element;
10+
11+
/**
12+
* @inheritdoc
13+
*/
14+
class SelectconditionElement extends SelectElement
15+
{
16+
/**
17+
* @inheritdoc
18+
*/
19+
protected $optionByValue = './/option[normalize-space(.)=%s]';
20+
}

dev/tests/integration/testsuite/Magento/Framework/Code/Generator/AutoloaderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private function getTestFrameworkObjectManager()
3131
/**
3232
* @before
3333
*/
34-
public function setupLoggerTestDouble(): void
34+
public function setupLoggerTestDouble()
3535
{
3636
$loggerTestDouble = $this->createMock(LoggerInterface::class);
3737
$this->getTestFrameworkObjectManager()->addSharedInstance($loggerTestDouble, MagentoMonologLogger::class);
@@ -40,7 +40,7 @@ public function setupLoggerTestDouble(): void
4040
/**
4141
* @after
4242
*/
43-
public function removeLoggerTestDouble(): void
43+
public function removeLoggerTestDouble()
4444
{
4545
$this->getTestFrameworkObjectManager()->removeSharedInstance(MagentoMonologLogger::class);
4646
}
@@ -58,7 +58,7 @@ private function createExceptionThrowingGeneratorTestDouble(\RuntimeException $t
5858
return $generatorStub;
5959
}
6060

61-
public function testLogsExceptionDuringGeneration(): void
61+
public function testLogsExceptionDuringGeneration()
6262
{
6363
$exceptionMessage = 'Test exception thrown during generation';
6464
$testException = new \RuntimeException($exceptionMessage);
@@ -70,7 +70,7 @@ public function testLogsExceptionDuringGeneration(): void
7070
$this->assertNull($autoloader->load(NonExistingClassName::class));
7171
}
7272

73-
public function testFiltersDuplicateExceptionMessages(): void
73+
public function testFiltersDuplicateExceptionMessages()
7474
{
7575
$exceptionMessage = 'Test exception thrown during generation';
7676
$testException = new \RuntimeException($exceptionMessage);

dev/tests/static/framework/Magento/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525

2626
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
2727
<rule ref="Squiz.Functions.GlobalFunction"/>
28+
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
2829
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
2930
</ruleset>

lib/internal/Magento/Framework/Code/Generator/Autoloader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function load($className)
6262
*
6363
* @param \Exception $exception
6464
*/
65-
private function tryToLogExceptionMessageIfNotDuplicate(\Exception $exception): void
65+
private function tryToLogExceptionMessageIfNotDuplicate(\Exception $exception)
6666
{
6767
if ($this->lastGenerationErrorMessage !== $exception->getMessage()) {
6868
$this->lastGenerationErrorMessage = $exception->getMessage();
@@ -84,7 +84,7 @@ private function tryToLogExceptionMessageIfNotDuplicate(\Exception $exception):
8484
* @param \Exception $exception
8585
* @return void
8686
*/
87-
private function tryToLogException(\Exception $exception): void
87+
private function tryToLogException(\Exception $exception)
8888
{
8989
try {
9090
$logger = ObjectManager::getInstance()->get(LoggerInterface::class);

0 commit comments

Comments
 (0)