@@ -135,6 +135,12 @@ public function testUrlToPathWithDomainBasedCaching(): void
135135 'domain2.com/parent/child ' ,
136136 $ urlToPath ->invokeArgs ($ this ->fsp , [$ url ])
137137 );
138+
139+ $ url = 'https://domain2.com/parent/child ' ;
140+ $ this ->assertSame (
141+ 'domain2.com/parent/child ' ,
142+ $ urlToPath ->invokeArgs ($ this ->fsp , [$ url ])
143+ );
138144 }
139145
140146 public function testMenu2LinkingMode (): void
@@ -351,7 +357,22 @@ public function providePathsToURL()
351357 ];
352358 }
353359
354- public function testGetPublishedURLs (): void
360+ public function provideGetPublishedURLs (): array
361+ {
362+ return [
363+ [
364+ 'baseURL ' => 'http://example.com ' ,
365+ ],
366+ [
367+ 'baseURL ' => 'https://example.com ' ,
368+ ],
369+ ];
370+ }
371+
372+ /**
373+ * @dataProvider provideGetPublishedURLs
374+ */
375+ public function testGetPublishedURLs (string $ baseUrl ): void
355376 {
356377 $ level1 = new StaticPublisherTestPage ();
357378 $ level1 ->URLSegment = 'find-me ' ;
@@ -368,19 +389,19 @@ public function testGetPublishedURLs(): void
368389
369390 $ this ->fsp ->publishURL ('find-me ' , true );
370391 // We have to redeclare this config because the testkernel wipes it when we generate the page response
371- Director::config ()->set ('alternate_base_url ' , ' http://example.com ' );
392+ Director::config ()->set ('alternate_base_url ' , $ baseUrl );
372393
373- $ this ->assertSame ([' http://example.com /find-me ' ], $ this ->fsp ->getPublishedURLs ());
394+ $ this ->assertSame ([$ baseUrl . ' /find-me ' ], $ this ->fsp ->getPublishedURLs ());
374395
375396 $ this ->fsp ->publishURL ($ level2_1 ->Link (), true );
376- Director::config ()->set ('alternate_base_url ' , ' http://example.com ' );
397+ Director::config ()->set ('alternate_base_url ' , $ baseUrl );
377398
378399 $ urls = $ this ->fsp ->getPublishedURLs ();
379- $ this ->assertContains (' http://example.com /find-me ' , $ urls );
380- $ this ->assertContains (' http://example.com /find-me/find-me-child ' , $ urls );
400+ $ this ->assertContains ($ baseUrl . ' /find-me ' , $ urls );
401+ $ this ->assertContains ($ baseUrl . ' /find-me/find-me-child ' , $ urls );
381402 $ this ->assertCount (2 , $ urls );
382403
383404 $ this ->fsp ->purgeURL ('find-me ' );
384- $ this ->assertSame ([' http://example.com /find-me/find-me-child ' ], $ this ->fsp ->getPublishedURLs ());
405+ $ this ->assertSame ([$ baseUrl . ' /find-me/find-me-child ' ], $ this ->fsp ->getPublishedURLs ());
385406 }
386407}
0 commit comments