@@ -91,7 +91,7 @@ public function testListenerMustThrowExceptionBecauseTheShopURLIsNotReachable():
9191
9292 $ shop = $ this ->createMock (ShopInterface::class);
9393 $ shop
94- ->expects (self ::exactly ( 2 ))
94+ ->expects (self ::once ( ))
9595 ->method ('getShopUrl ' )
9696 ->willReturn ('https://shop-url.com ' );
9797
@@ -124,7 +124,7 @@ public function testListenerMustThrowExceptionBecauseTheShopURLRedirectsToAnothe
124124
125125 $ shop = $ this ->createMock (ShopInterface::class);
126126 $ shop
127- ->expects (self ::exactly ( 2 ))
127+ ->expects (self ::once ( ))
128128 ->method ('getShopUrl ' )
129129 ->willReturn ('https://shop-url.com ' );
130130
@@ -150,6 +150,35 @@ public function testListenerMustThrowExceptionBecauseTheShopURLRedirectsToAnothe
150150 );
151151 }
152152
153+ public function testRequestSentWithoutDoubleBackslash ()
154+ {
155+ $ shop = $ this ->createMock (ShopInterface::class);
156+ $ shop
157+ ->expects (self ::once ())
158+ ->method ('getShopUrl ' )
159+ ->willReturn ('https://shop-url.com/ ' );
160+
161+ $ this ->httpClient
162+ ->expects (self ::once ())
163+ ->method ('request ' )
164+ ->with ('HEAD ' , 'https://shop-url.com/api/_info/config ' , [
165+ 'timeout ' => 10 ,
166+ 'max_redirects ' => 0 ,
167+ ]);
168+
169+ $ listener = new BeforeRegistrationStartsListener (
170+ $ this ->httpClient ,
171+ true
172+ );
173+
174+ $ listener ->__invoke (
175+ new BeforeRegistrationStartsEvent (
176+ $ this ->createMock (RequestInterface::class),
177+ $ shop
178+ )
179+ );
180+ }
181+
153182 #[DataProvider('unauthorizedHttpExceptionProvider ' )]
154183 public function testListenerDoesNotThrowExceptionWhenTheExceptionCodeIsHTTPUnauthorized ($ exception ): void
155184 {
0 commit comments