Skip to content

Commit a2ae9b1

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

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
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" />
4645
</event>
4746
<event name="magento_catalog_api_data_categorytreeinterface_delete_before">
4847
<observer name="legacy_categorytree_delete_before" instance="Magento\Framework\EntityManager\Observer\BeforeEntityDelete" />

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/**
2222
* User backend observer model for authentication
2323
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2425
*/
2526
class AuthObserver implements ObserverInterface
2627
{
@@ -184,6 +185,7 @@ private function _updateLockingInformation($user)
184185

185186
/**
186187
* Check whether the latest password is expired
188+
*
187189
* Side-effect can be when passwords were changed with different lifetime configuration settings
188190
*
189191
* @param array $latestPassword

lib/internal/Magento/Framework/EntityManager/TypeResolver.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Framework\EntityManager;
77

8+
use Magento\Catalog\Model\Category;
9+
810
/**
911
* Resolves types.
1012
*/
@@ -54,7 +56,7 @@ public function resolve($type)
5456
$interfaceNames = $reflectionClass->getInterfaceNames();
5557
$dataInterfaces = [];
5658
foreach ($interfaceNames as $interfaceName) {
57-
if (strpos($interfaceName, '\Api\Data\\') !== false) {
59+
if ($this->isDataInterface($interfaceName, $type)) {
5860
$dataInterfaces[] = $interfaceName;
5961
}
6062
}
@@ -73,4 +75,17 @@ public function resolve($type)
7375
}
7476
return $this->typeMapping[$className];
7577
}
78+
79+
/**
80+
* Checks whether interface has Data type.
81+
*
82+
* @param string $interfaceName
83+
* @param object $entityType
84+
* @return bool
85+
*/
86+
private function isDataInterface(string $interfaceName, $entityType): bool
87+
{
88+
return strpos($interfaceName, '\Api\Data\\') !== false
89+
&& (!$entityType instanceof Category || preg_match('/Category(?!Tree)/', $interfaceName));
90+
}
7691
}

0 commit comments

Comments
 (0)