@@ -28,15 +28,13 @@ public function testGetServerSideUrlWithCustomUrl(): void
2828 $ this ->assertSame ('https://custom/mercure ' , $ service ->getServerSideUrl ());
2929 }
3030
31- public function testGetServerSideUrlWithDefault (): void
31+ public function testGetServerSideUrlThrowsWhenNotConfigured (): void
3232 {
33- $ service = new UrlService (
34- null ,
35- null ,
36- $ this ->createRequestStackWithRequest ('https://example.com ' )
37- );
33+ $ service = new UrlService (null , null , new RequestStack ());
3834
39- $ this ->assertSame ('https://example.com/hub/.well-known/mercure ' , $ service ->getServerSideUrl ());
35+ $ this ->expectException (LogicException::class);
36+ $ this ->expectExceptionMessage ('Mercure server URL is not configured. ' );
37+ $ service ->getServerSideUrl ();
4038 }
4139
4240 public function testGetClientSideUrlWithCustomUrlReplacesPlaceholder (): void
@@ -66,18 +64,19 @@ public function testThrowsLogicExceptionWithoutRequest(): void
6664 $ service = new UrlService (null , null , new RequestStack ());
6765
6866 $ this ->expectException (LogicException::class);
69- $ service ->getServerSideUrl ();
67+ $ this ->expectExceptionMessage ('Mercure fallback URL resolution requires an active HTTP request. ' );
68+ $ service ->getClientSideUrl ();
7069 }
7170
72- public function testDefaultUrlIncludesNonStandardPort (): void
71+ public function testDefaultClientUrlIncludesNonStandardPort (): void
7372 {
7473 $ service = new UrlService (
7574 null ,
7675 null ,
7776 $ this ->createRequestStackWithRequest ('http://localhost:8080 ' )
7877 );
7978
80- $ this ->assertSame ('http://localhost:8080/hub/.well-known/mercure ' , $ service ->getServerSideUrl ());
79+ $ this ->assertSame ('http://localhost:8080/hub ' , $ service ->getClientSideUrl ());
8180 }
8281
8382 private function createRequestStackWithRequest (string $ uri ): RequestStack
0 commit comments