@@ -14,7 +14,7 @@ class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase', true);
1414class FticksTest extends \PHPUnit_Framework_TestCase
1515{
1616 /** @var array minimal request */
17- private static $ _minrequest = [
17+ private static $ minRequest = [
1818 'Source ' => [
1919 'entityid ' => 'https://localhost/sp ' ,
2020 ],
@@ -24,7 +24,7 @@ class FticksTest extends \PHPUnit_Framework_TestCase
2424 ];
2525
2626 /** @var array SP request */
27- private static $ _sprequest =[
27+ private static $ spRequest =[
2828 'saml:sp:IdP ' => 'https://localhost/saml:sp:IdP ' ,
2929 'saml:sp:SessionIndex ' => 'saml:sp:SessionIndex ' ,
3030 'saml:sp:State ' => [
@@ -34,7 +34,7 @@ class FticksTest extends \PHPUnit_Framework_TestCase
3434 ];
3535
3636 /** @var array IdP request */
37- private static $ _idprequest = [
37+ private static $ idpRequest = [
3838 'SimpleSAML_Auth_State.id ' => 'SimpleSAML_Auth_State.id ' ,
3939 'SimpleSAML_Auth_State.stage ' => 'sspmod_core_Auth_UserPassBase.state ' ,
4040 'UserID ' => 'user1@example.org ' ,
@@ -75,8 +75,8 @@ protected function setUp()
7575 public function testMinimal ()
7676 {
7777 $ config = ['federation ' => 'ACME ' , 'logdest ' => 'stdout ' ];
78- $ request = self ::$ _minrequest ;
79- $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' ,'/ ' ).'[^#]+#TS=\d+#$/ ' );
78+ $ request = self ::$ minRequest ;
79+ $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' , '/ ' ).'[^#]+#TS=\d+#$/ ' );
8080 $ result = self ::processFilter ($ config , $ request );
8181 }
8282
@@ -86,8 +86,8 @@ public function testMinimal()
8686 public function testAsServiceProvider ()
8787 {
8888 $ config = ['federation ' => 'ACME ' , 'logdest ' => 'stdout ' ,];
89- $ request = array_merge (self ::$ _minrequest , self ::$ _sprequest );
90- $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/saml:sp:IdP#RP=https://localhost/idp#CSI=CL ' ,'/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified#TS=1000# ' ,'/ ' ).'$/ ' );
89+ $ request = array_merge (self ::$ minRequest , self ::$ spRequest );
90+ $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/saml:sp:IdP#RP=https://localhost/idp#CSI=CL ' , '/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified#TS=1000# ' , '/ ' ).'$/ ' );
9191 $ result = self ::processFilter ($ config , $ request );
9292 }
9393
@@ -97,12 +97,12 @@ public function testAsServiceProvider()
9797 public function testSPwithUserId ()
9898 {
9999 $ config = ['federation ' => 'ACME ' , 'logdest ' => 'stdout ' , 'userId ' => 'eduPersonPrincipalName ' ];
100- $ request = array_merge (self ::$ _minrequest , self ::$ _sprequest , [
100+ $ request = array_merge (self ::$ minRequest , self ::$ spRequest , [
101101 'Attributes ' => [
102102 'eduPersonPrincipalName ' => 'user2@example.net ' ,
103103 ],
104104 ]);
105- $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/saml:sp:IdP#RP=https://localhost/idp#CSI=CL ' ,'/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified#PN=e5d066a96d5809a21264e153013c3c793e6574cb77afdfa248ad2cefab9b0451#TS=1000# ' ,'/ ' ).'$/ ' );
105+ $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/saml:sp:IdP#RP=https://localhost/idp#CSI=CL ' , '/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified#PN=e5d066a96d5809a21264e153013c3c793e6574cb77afdfa248ad2cefab9b0451#TS=1000# ' , '/ ' ).'$/ ' );
106106 $ result = self ::processFilter ($ config , $ request );
107107 }
108108
@@ -112,8 +112,8 @@ public function testSPwithUserId()
112112 public function testAsIdentityProvider ()
113113 {
114114 $ config = ['federation ' => 'ACME ' , 'logdest ' => 'stdout ' ,];
115- $ request = array_merge (self ::$ _minrequest , self ::$ _idprequest );
116- $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' ,'/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:Password#PN=d844a9a0666bb3990e88f72b8f5c20accbcfa46f7b8a7ab38593bfbbab6e9cbc#TS= ' ,'/ ' ).'\d+#$/ ' );
115+ $ request = array_merge (self ::$ minRequest , self ::$ idpRequest );
116+ $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' , '/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:Password#PN=d844a9a0666bb3990e88f72b8f5c20accbcfa46f7b8a7ab38593bfbbab6e9cbc#TS= ' , '/ ' ).'\d+#$/ ' );
117117 $ result = self ::processFilter ($ config , $ request );
118118 }
119119
@@ -131,13 +131,13 @@ public function testExample()
131131 'exclude ' => ['PN ' ],
132132 'logdest ' => 'stdout ' ,
133133 ];
134- $ request = array_merge (self ::$ _minrequest , self ::$ _idprequest , [
134+ $ request = array_merge (self ::$ minRequest , self ::$ idpRequest , [
135135 'Attributes ' => [
136136 'eduPersonPrincipalName ' => 'user3@example.com ' ,
137137 'schacHomeOrganization ' => 'example.com ' ,
138138 ],
139139 ]);
140- $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' ,'/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:Password#TS= ' ,'/ ' ).'\d+#REALM=example.com#$/ ' );
140+ $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' , '/ ' ).'[^#]+ ' .preg_quote ('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:Password#TS= ' , '/ ' ).'\d+#REALM=example.com#$/ ' );
141141 $ result = self ::processFilter ($ config , $ request );
142142 }
143143
@@ -147,8 +147,8 @@ public function testExample()
147147 public function testFilteringArray ()
148148 {
149149 $ config = ['federation ' => 'ACME ' , 'logdest ' => 'stdout ' , 'exclude ' => ['PN ' , 'AM ' ]];
150- $ request = array_merge (self ::$ _minrequest , self ::$ _idprequest );
151- $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' ,'/ ' ).'[^#]+#TS=\d+#$/ ' );
150+ $ request = array_merge (self ::$ minRequest , self ::$ idpRequest );
151+ $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' , '/ ' ).'[^#]+#TS=\d+#$/ ' );
152152 $ result = self ::processFilter ($ config , $ request );
153153 }
154154
@@ -158,8 +158,8 @@ public function testFilteringArray()
158158 public function testFilteringString ()
159159 {
160160 $ config = ['federation ' => 'ACME ' , 'logdest ' => 'stdout ' , 'exclude ' => 'AM ' ];
161- $ request = array_merge (self ::$ _minrequest , self ::$ _idprequest );
162- $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' ,'/ ' ).'[^#]+ ' .preg_quote ('#PN=d844a9a0666bb3990e88f72b8f5c20accbcfa46f7b8a7ab38593bfbbab6e9cbc#TS= ' ,'/ ' ).'\d+#$/ ' );
161+ $ request = array_merge (self ::$ minRequest , self ::$ idpRequest );
162+ $ this ->expectOutputRegex ('/^ ' .preg_quote ('F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL ' , '/ ' ).'[^#]+ ' .preg_quote ('#PN=d844a9a0666bb3990e88f72b8f5c20accbcfa46f7b8a7ab38593bfbbab6e9cbc#TS= ' , '/ ' ).'\d+#$/ ' );
163163 $ result = self ::processFilter ($ config , $ request );
164164 }
165165}
0 commit comments