File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 22
33/**
44 * Unit tests for Utils class
5+ *
6+ * @backupStaticAttributes enabled
57 */
68class OneLogin_Saml2_UtilsTest extends PHPUnit_Framework_TestCase
79{
@@ -14,7 +16,7 @@ class OneLogin_Saml2_UtilsTest extends PHPUnit_Framework_TestCase
1416/*
1517 public function testT()
1618 {
17- setlocale(LC_MESSAGES, 'en_US');
19+ setlocale(LC_MESSAGES, 'en_US');
1820
1921 $msg = 'test';
2022 $translatedMsg = OneLogin_Saml2_Utils::t($msg);
@@ -275,6 +277,26 @@ public function testRedirect()
275277 $ this ->assertEquals ("http:// $ hostname/example?alphavalue=a&numvaluelist[]= " , $ targetUrl8 );
276278 }
277279
280+ /**
281+ * @covers OneLogin_Saml2_Utils::setProxyVars()
282+ * @covers OneLogin_Saml2_Utils::getProxyVars()
283+ */
284+ public function testProxyvars ()
285+ {
286+ $ this ->assertFalse (OneLogin_Saml2_Utils::getProxyVars ());
287+
288+ OneLogin_Saml2_Utils::setProxyVars (true );
289+ $ this ->assertTrue (OneLogin_Saml2_Utils::getProxyVars ());
290+
291+ $ _SERVER ['HTTP_X_FORWARDED_PROTO ' ] = 'https ' ;
292+ $ _SERVER ['SERVER_PORT ' ] = '80 ' ;
293+
294+ $ this ->assertTrue (OneLogin_Saml2_Utils::isHTTPS ());
295+
296+ OneLogin_Saml2_Utils::setProxyVars (false );
297+ $ this ->assertFalse (OneLogin_Saml2_Utils::isHTTPS ());
298+ }
299+
278300 /**
279301 * Tests the getSelfHost method of the OneLogin_Saml2_Utils
280302 *
You can’t perform that action at this time.
0 commit comments