Skip to content

Commit 12296fa

Browse files
committed
MC-33699: Stabilize MFTF tests
1 parent ec90295 commit 12296fa

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

app/code/Magento/Catalog/etc/events.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
</event>
4343
<event name="magento_catalog_api_data_categorytreeinterface_save_after">
4444
<observer name="legacy_categorytree_save_after" instance="Magento\Framework\EntityManager\Observer\AfterEntitySave" />
45+
<observer name="invalidate_cache_on_categorytree_design_change" instance="Magento\Catalog\Observer\InvalidateCacheOnCategoryDesignChange" />
4546
</event>
4647
<event name="magento_catalog_api_data_categorytreeinterface_delete_before">
4748
<observer name="legacy_categorytree_delete_before" instance="Magento\Framework\EntityManager\Observer\BeforeEntityDelete" />

app/code/Magento/Checkout/Model/Sidebar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected function normalize($itemQty)
130130
$filter = new \Zend_Filter_LocalizedToNormalized(
131131
['locale' => $this->resolver->getLocale()]
132132
);
133-
return $filter->filter($itemQty);
133+
return $filter->filter((string)$itemQty);
134134
}
135135
return $itemQty;
136136
}

app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniShoppingCartSubTotalActionGroup.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
<waitForPageLoad stepKey="waitForPageLoad" time="120"/>
2020
<grabTextFrom selector="{{StorefrontMinicartSection.miniCartSubtotalField}}" stepKey="grabMiniCartTotal"/>
21-
<assertContains stepKey="assertMiniCartTotal">
21+
<assertStringContainsString stepKey="assertMiniCartTotal">
2222
<actualResult type="variable">$grabMiniCartTotal</actualResult>
2323
<expectedResult type="string">{{dataQuote.subtotal}}</expectedResult>
24-
</assertContains>
25-
<assertContains stepKey="assertMiniCartCurrency">
24+
</assertStringContainsString>
25+
<assertStringContainsString stepKey="assertMiniCartCurrency">
2626
<actualResult type="variable">$grabMiniCartTotal</actualResult>
2727
<expectedResult type="string">{{dataQuote.currency}}</expectedResult>
28-
</assertContains>
28+
</assertStringContainsString>
2929
</actionGroup>
3030
</actionGroups>

app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options/Visual.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,14 @@ protected function reformatSwatchLabels($swatchStoreValue = null)
9494
}
9595
$newSwatch = [];
9696
foreach ($swatchStoreValue as $key => $value) {
97+
if (!is_string($value)) {
98+
continue;
99+
}
97100
if ($value[0] == '#') {
98-
$newSwatch[$key] = 'background: '.$value;
101+
$newSwatch[$key] = 'background: ' . $value;
99102
} elseif ($value[0] == '/') {
100103
$mediaUrl = $this->swatchHelper->getSwatchMediaUrl();
101-
$newSwatch[$key] = 'background: url('.$mediaUrl.$value.'); background-size: cover;';
104+
$newSwatch[$key] = 'background: url(' . $mediaUrl . $value . '); background-size: cover;';
102105
}
103106
}
104107
return $newSwatch;

app/code/Magento/User/Observer/Backend/AuthObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ private function _updateLockingInformation($user)
166166
$failuresNum = (int)$user->getFailuresNum() + 1;
167167
/** @noinspection PhpAssignmentInConditionInspection */
168168
if ($firstFailureDate = $user->getFirstFailure()) {
169-
$firstFailureDate = new \DateTime($firstFailureDate);
169+
$firstFailureDate = strtotime($user->getFirstFailure());
170170
}
171171

172172
$newFirstFailureDate = false;
173173
$updateLockExpires = false;
174174
$lockThreshInterval = new \DateInterval('PT' . $lockThreshold.'S');
175175
// set first failure date when this is first failure or last first failure expired
176-
if (1 === $failuresNum || !$firstFailureDate || $now->diff($firstFailureDate) > $lockThreshInterval) {
176+
if (1 === $failuresNum || !$firstFailureDate || (\time() - $firstFailureDate) > $lockThreshold) {
177177
$newFirstFailureDate = $now;
178178
// otherwise lock user
179179
} elseif ($failuresNum >= $maxFailures) {

0 commit comments

Comments
 (0)