44
55namespace SimpleSAML \Test \Module \metarefresh ;
66
7+ use Exception ;
78use PHPUnit \Framework \TestCase ;
89use SimpleSAML \Configuration ;
910
@@ -77,7 +78,7 @@ protected function setUp(): void
7778 $ this ->config = Configuration::loadFromArray (
7879 ['module.enable ' => ['metarefresh ' => true ]],
7980 '[ARRAY] ' ,
80- 'simplesaml '
81+ 'simplesaml ' ,
8182 );
8283 Configuration::setPreLoadedConfig ($ this ->config , 'config.php ' );
8384 $ this ->metaloader = new \SimpleSAML \Module \metarefresh \MetaLoader ();
@@ -106,20 +107,20 @@ public function testMetaLoader(): void
106107 $ output = $ this ->getActualOutputForAssertion ();
107108 try {
108109 eval ($ output );
109- } catch (\ Exception $ e ) {
110+ } catch (Exception $ e ) {
110111 $ this ->fail ('Metarefresh does not produce syntactially valid code ' );
111112 }
112113 $ this ->assertArrayHasKey ('https://idp.example.com/idp/shibboleth ' , $ metadata );
113114
114115 $ this ->assertTrue (
115- empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ]))
116+ empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ])),
116117 );
117118 }
118119
119120 public function testSignatureVerificationCertificatePass (): void
120121 {
121122 $ this ->metaloader ->loadSource (
122- array_merge ($ this ->source , ['certificates ' => [dirname (__FILE__ , 2 ) . '/mdx.pem ' ]])
123+ array_merge ($ this ->source , ['certificates ' => [dirname (__FILE__ , 2 ) . '/mdx.pem ' ]]),
123124 );
124125 $ this ->metaloader ->dumpMetadataStdOut ();
125126 $ this ->expectOutputRegex ('/UTEbMBkGA1UECgwSRXhhbXBsZSBVbml2ZXJzaXR5MRgwFgYDVQQDDA9pZHAuZXhh/ ' );
@@ -140,7 +141,7 @@ public function testWriteMetadataFiles(): void
140141 $ this ->assertArrayHasKey ('https://idp.example.com/idp/shibboleth ' , $ metadata );
141142 $ this ->assertTrue (
142143 /** @psalm-suppress UndefinedVariable */
143- empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ]))
144+ empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ])),
144145 );
145146 }
146147
@@ -158,7 +159,7 @@ public function testMetaLoaderSetExpiryWhenNotPresent(): void
158159 $ output = $ this ->getActualOutputForAssertion ();
159160 try {
160161 eval ($ output );
161- } catch (\ Exception $ e ) {
162+ } catch (Exception $ e ) {
162163 $ this ->fail ('Metarefresh does not produce syntactially valid code ' );
163164 }
164165 $ this ->assertArrayHasKey ('https://idp.example.com/idp/shibboleth ' , $ metadata );
@@ -189,14 +190,14 @@ public function testAttributewhitelist1(): void
189190 $ output = $ this ->getActualOutputForAssertion ();
190191 try {
191192 eval ($ output );
192- } catch (\ Exception $ e ) {
193+ } catch (Exception $ e ) {
193194 $ this ->fail ('Metarefresh does not produce syntactially valid code ' );
194195 }
195196 /* Check we matched the IdP */
196197 $ this ->assertArrayHasKey ('https://idp.example.com/idp/shibboleth ' , $ metadata );
197198
198199 $ this ->assertTrue (
199- empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ]))
200+ empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ])),
200201 );
201202 }
202203
@@ -257,15 +258,15 @@ public function testAttributewhitelist3(): void
257258 $ output = $ this ->getActualOutputForAssertion ();
258259 try {
259260 eval ($ output );
260- } catch (\ Exception $ e ) {
261+ } catch (Exception $ e ) {
261262 $ this ->fail ('Metarefresh does not produce syntactially valid code ' );
262263 }
263264
264265 /* Check we matched the IdP */
265266 $ this ->assertArrayHasKey ('https://idp.example.com/idp/shibboleth ' , $ metadata );
266267
267268 $ this ->assertTrue (
268- empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ]))
269+ empty (array_diff_key ($ this ->expected , $ metadata ['https://idp.example.com/idp/shibboleth ' ])),
269270 );
270271 }
271272}
0 commit comments