@@ -80,12 +80,16 @@ protected function setUp(): void
80
80
*/
81
81
public function testIfCustomPathUsed (): void
82
82
{
83
- $ this ->configMock
83
+ $ this ->configMock ->expects ($ this ->once ())
84
+ ->method ('isSetFlag ' )
85
+ ->with (FrontNameResolver::XML_PATH_USE_CUSTOM_ADMIN_PATH )
86
+ ->willReturn (true );
87
+
88
+ $ this ->configMock ->expects ($ this ->once ())
84
89
->method ('getValue ' )
85
- ->willReturnCallback (fn ($ param ) => match ([$ param ]) {
86
- ['admin/url/use_custom_path ' ] => true ,
87
- ['admin/url/custom_path ' ] => 'expectedValue '
88
- });
90
+ ->with (FrontNameResolver::XML_PATH_CUSTOM_ADMIN_PATH )
91
+ ->willReturn ('expectedValue ' );
92
+
89
93
$ this ->assertEquals ('expectedValue ' , $ this ->model ->getFrontName ());
90
94
}
91
95
@@ -94,15 +98,11 @@ public function testIfCustomPathUsed(): void
94
98
*/
95
99
public function testIfCustomPathNotUsed (): void
96
100
{
97
- $ this ->configMock ->expects (
98
- $ this ->once ()
99
- )->method (
100
- 'getValue '
101
- )->with (
102
- 'admin/url/use_custom_path '
103
- )->willReturn (
104
- false
105
- );
101
+ $ this ->configMock ->expects ($ this ->once ())
102
+ ->method ('isSetFlag ' )
103
+ ->with (FrontNameResolver::XML_PATH_USE_CUSTOM_ADMIN_PATH )
104
+ ->willReturn (false );
105
+
106
106
$ this ->assertEquals ($ this ->_defaultFrontName , $ this ->model ->getFrontName ());
107
107
}
108
108
@@ -125,7 +125,12 @@ public function testIsHostBackend(
125
125
string $ customAdminUrl ,
126
126
bool $ expectedValue
127
127
): void {
128
- $ this ->scopeConfigMock ->method ('getValue ' )
128
+ $ this ->scopeConfigMock
129
+ ->method ('isSetFlag ' )
130
+ ->willReturn ($ useCustomAdminUrl );
131
+
132
+ $ this ->scopeConfigMock
133
+ ->method ('getValue ' )
129
134
->willReturnMap (
130
135
[
131
136
[Store::XML_PATH_UNSECURE_BASE_URL , ScopeInterface::SCOPE_STORE , null , $ url ],
@@ -138,7 +143,7 @@ public function testIsHostBackend(
138
143
],
139
144
[
140
145
FrontNameResolver::XML_PATH_CUSTOM_ADMIN_URL ,
141
- ScopeInterface:: SCOPE_STORE ,
146
+ ScopeConfigInterface:: SCOPE_TYPE_DEFAULT ,
142
147
null ,
143
148
$ customAdminUrl
144
149
]
0 commit comments