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