Skip to content

Commit 4b67e14

Browse files
Merge branch '2.4-develop' into julprs
2 parents 396a774 + 55a006b commit 4b67e14

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

dev/tests/integration/framework/Magento/TestFramework/Annotation/AppIsolation.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
/**
1616
* Implementation of the @magentoAppIsolation DocBlock annotation - isolation of global application objects in memory
17+
*
18+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1719
*/
1820
class AppIsolation
1921
{
@@ -50,6 +52,13 @@ public function __construct(Application $application)
5052
protected function _isolateApp()
5153
{
5254
if ($this->hasNonIsolatedTests) {
55+
// Clear fixture resolver state before app reinitialization
56+
try {
57+
$resolver = \Magento\TestFramework\Workaround\Override\Fixture\Resolver::getInstance();
58+
$resolver->setCurrentTest(null);
59+
} catch (\RuntimeException $e) {
60+
// Resolver not initialized yet, ignore
61+
}
5362
$this->application->reinitialize();
5463
$_SESSION = [];
5564
$_COOKIE = [];

dev/tests/integration/framework/Magento/TestFramework/App/Config.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
22
/**
3-
* Application configuration object. Used to access configuration when application is initialized and installed.
4-
*
5-
* Copyright © Magento, Inc. All rights reserved.
6-
* See COPYING.txt for license details.
3+
* Copyright 2016 Adobe
4+
* All Rights Reserved.
75
*/
86
namespace Magento\TestFramework\App;
97

@@ -70,14 +68,21 @@ public function setValue(
7068
) {
7169
$result = $this->get('system');
7270

71+
$originalScope = $scope;
7372
if ($scope === 'store') {
7473
$scope = 'stores';
7574
} elseif ($scope === 'website') {
7675
$scope = 'websites';
7776
}
7877

7978
if (empty($scopeCode)) {
80-
$scopeCode = $this->getScopeCodeResolver()->resolve($scope, $scopeCode);
79+
// Use original scope type for resolver, as it expects 'store'/'website', not 'stores'/'websites'
80+
try {
81+
$scopeCode = $this->getScopeCodeResolver()->resolve($originalScope, $scopeCode);
82+
} catch (\Exception $e) {
83+
// If scope resolver fails (e.g., during app isolation), fallback to default scope code
84+
$scopeCode = null;
85+
}
8186
}
8287

8388
$keys = explode('/', $path);
@@ -99,7 +104,7 @@ public function setValue(
99104
* @param mixed $value
100105
* @return void
101106
*/
102-
private function updateResult(array $keys, & $result, $value)
107+
private function updateResult(array $keys, &$result, $value)
103108
{
104109
$key = array_shift($keys);
105110

0 commit comments

Comments
 (0)