@@ -80,12 +80,16 @@ protected function setUp(): void
8080 */
8181 public function testIfCustomPathUsed (): void
8282 {
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 ())
8489 ->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+
8993 $ this ->assertEquals ('expectedValue ' , $ this ->model ->getFrontName ());
9094 }
9195
@@ -94,15 +98,11 @@ public function testIfCustomPathUsed(): void
9498 */
9599 public function testIfCustomPathNotUsed (): void
96100 {
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+
106106 $ this ->assertEquals ($ this ->_defaultFrontName , $ this ->model ->getFrontName ());
107107 }
108108
@@ -125,7 +125,12 @@ public function testIsHostBackend(
125125 string $ customAdminUrl ,
126126 bool $ expectedValue
127127 ): void {
128- $ this ->scopeConfigMock ->method ('getValue ' )
128+ $ this ->scopeConfigMock
129+ ->method ('isSetFlag ' )
130+ ->willReturn ($ useCustomAdminUrl );
131+
132+ $ this ->scopeConfigMock
133+ ->method ('getValue ' )
129134 ->willReturnMap (
130135 [
131136 [Store::XML_PATH_UNSECURE_BASE_URL , ScopeInterface::SCOPE_STORE , null , $ url ],
@@ -138,7 +143,7 @@ public function testIsHostBackend(
138143 ],
139144 [
140145 FrontNameResolver::XML_PATH_CUSTOM_ADMIN_URL ,
141- ScopeInterface:: SCOPE_STORE ,
146+ ScopeConfigInterface:: SCOPE_TYPE_DEFAULT ,
142147 null ,
143148 $ customAdminUrl
144149 ]
0 commit comments