@@ -460,6 +460,9 @@ public function testSetBaseURLPath()
460
460
{
461
461
$ this ->assertNull (Utils::getBaseURLPath ());
462
462
463
+ Utils::setBaseURLPath ('/ ' );
464
+ $ this ->assertEquals ('/ ' , Utils::getBaseURLPath ());
465
+
463
466
Utils::setBaseURLPath ('sp ' );
464
467
$ this ->assertEquals ('/sp/ ' , Utils::getBaseURLPath ());
465
468
@@ -473,6 +476,25 @@ public function testSetBaseURLPath()
473
476
$ this ->assertEquals ('/sp/ ' , Utils::getBaseURLPath ());
474
477
}
475
478
479
+ /**
480
+ * @covers OneLogin\Saml2\Utils::setBaseURLPath
481
+ */
482
+ public function testSetBaseURLPath2 ()
483
+ {
484
+ $ _SERVER ['HTTP_HOST ' ] = 'sp.example.com ' ;
485
+ $ _SERVER ['HTTPS ' ] = 'https ' ;
486
+ $ _SERVER ['REQUEST_URI ' ] = null ;
487
+ $ _SERVER ['QUERY_STRING ' ] = null ;
488
+ $ _SERVER ['SCRIPT_NAME ' ] = '/ ' ;
489
+ unset($ _SERVER ['PATH_INFO ' ]);
490
+
491
+ Utils::setBaseURLPath ('/ ' );
492
+ $ this ->assertEquals ("https://sp.example.com/ " , Utils::getSelfURLNoQuery ());
493
+ $ this ->assertEquals ("https://sp.example.com/ " , Utils::getSelfRoutedURLNoQuery ());
494
+ $ this ->assertEquals ("https://sp.example.com/ " , Utils::getSelfURL ());
495
+ $ this ->assertEquals ('/ ' , Utils::getBaseURLPath ());
496
+ }
497
+
476
498
/**
477
499
* @covers OneLogin\Saml2\Utils::setBaseURL
478
500
*
0 commit comments