Skip to content

Commit 8121469

Browse files
committed
ACP2E-1512: Env variable config not working for store views with capital letters in the code
adjusted unit tests
1 parent 3f2fa9c commit 8121469

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/internal/Magento/Framework/App/Config/ScopeCodeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function resolve($scopeType, $scopeCode)
5959
$scopeCode = $resolverScopeCode;
6060
}
6161

62-
$this->resolvedScopeCodes[$scopeType][$scopeCode] = strtolower($resolverScopeCode);
62+
$this->resolvedScopeCodes[$scopeType][$scopeCode] = $resolverScopeCode ?: strtolower($resolverScopeCode);
6363

6464
return $this->resolvedScopeCodes[$scopeType][$scopeCode];
6565
}

lib/internal/Magento/Framework/App/Test/Unit/Config/ScopeCodeResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ public function testResolve()
6767
$this->scope->expects($this->once())
6868
->method('getCode')
6969
->willReturn($scopeCode);
70-
$this->assertEquals($scopeCode, $this->scopeCodeResolver->resolve($scopeType, $scopeId));
70+
$this->assertEquals(strtolower($scopeCode), $this->scopeCodeResolver->resolve($scopeType, $scopeId));
7171
}
7272
}

lib/internal/Magento/Framework/App/Test/Unit/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testGetValue($scope, $scopeCode = null)
7171
}
7272
$this->configType->expects($this->once())
7373
->method('get')
74-
->with($scope =='store' ? 'stores/path' : 'websites/myWebsite/path')
74+
->with($scope =='store' ? 'stores/path' : 'websites/mywebsite/path')
7575
->willReturn(true);
7676

7777
$this->assertTrue($this->appConfig->getValue($path, $scope, $scopeCode ?: $this->scope));

0 commit comments

Comments
 (0)