1111
1212final class ExpiryDateTest extends TestCase
1313{
14- /** @var array valid configuration */
15- private static $ config = [
14+ /** @var array<mixed> $config valid configuration */
15+ private static array $ config = [
1616 'class ' => 'expirycheck:ExpiryDate ' ,
1717 'netid_attr ' => 'userPrincipalName ' ,
1818 'expirydate_attr ' => 'accountExpires ' ,
@@ -21,8 +21,13 @@ final class ExpiryDateTest extends TestCase
2121 'date_format ' => 'd.m.Y ' , # php date syntax
2222 ];
2323
24- /** @var array minimal request */
25- private static $ minRequest = [
24+ /**
25+ * The phpstan-ignore is necessary as long as we can't run testProcessNoExpiry
26+ *
27+ * @var array<mixed> $minRequest minimal request
28+ * @phpstan-ignore property.onlyWritten
29+ */
30+ private static array $ minRequest = [
2631 'Source ' => [
2732 'entityid ' => 'https://localhost/sp ' ,
2833 ],
@@ -40,8 +45,8 @@ public function testInvalidWarndaysbefore(): void
4045 $ this ->expectException (Error \Exception::class);
4146 $ this ->expectExceptionMessage ("Invalid value for number of days given to expirycheck::ExpiryDate filter. " );
4247 $ filter = new ExpiryDate ($ config , null );
43- self ::fail ();
4448 $ filter ->checkDate (1 );
49+ self ::fail ();
4550 }
4651
4752 /**
@@ -53,8 +58,8 @@ public function testInvalidNetidAttr(): void
5358 $ msg = "Invalid attribute name given as eduPersonPrincipalName to expirycheck::ExpiryDate filter. " ;
5459 $ this ->expectExceptionMessage ($ msg );
5560 $ filter = new ExpiryDate ($ config , null );
56- self ::fail ();
5761 $ filter ->checkDate (1 );
62+ self ::fail ();
5863 }
5964
6065 /**
@@ -66,8 +71,8 @@ public function testInvalidExpirydateAttr(): void
6671 $ msg = "Invalid attribute name given as schacExpiryDate to expirycheck::ExpiryDate filter. " ;
6772 $ this ->expectExceptionMessage ($ msg );
6873 $ filter = new ExpiryDate ($ config , null );
69- self ::fail ();
7074 $ filter ->checkDate (1 );
75+ self ::fail ();
7176 }
7277
7378 /**
@@ -79,8 +84,8 @@ public function testInvalidDateFormat(): void
7984 $ msg = "Invalid date format given to expirycheck::ExpiryDate filter. " ;
8085 $ this ->expectExceptionMessage ($ msg );
8186 $ filter = new ExpiryDate ($ config , null );
82- self ::fail ();
8387 $ filter ->checkDate (1 );
88+ self ::fail ();
8489 }
8590
8691 /**
@@ -92,8 +97,8 @@ public function testInvalidConvertToUnixtime(): void
9297 $ msg = "Invalid value for convert_expirydate_to_unixtime given to expirycheck::ExpiryDate filter. " ;
9398 $ this ->expectExceptionMessage ($ msg );
9499 $ filter = new ExpiryDate ($ config , null );
95- self ::fail ();
96100 $ filter ->checkDate (1 );
101+ self ::fail ();
97102 }
98103
99104 /**
@@ -182,16 +187,16 @@ public function testProcessNoExpiry(): void
182187 {
183188 $ skipReason = 'https://github.com/simplesamlphp/simplesamlphp-test-framework/issues/3#issuecomment-1836154792 ' ;
184189 $ this ->markTestSkipped ($ skipReason );
185- $ filter = new ExpiryDate (self ::$ config , null );
186- $ initialState = ["Attributes " =>
187- [
188- 'userPrincipalName ' => ['test ' ],
189- 'accountExpires ' => ['20231228112510Z ' ],
190- ],
191- ];
192- $ request = array_merge (self ::$ minRequest , $ initialState );
193- $ state = $ initialState ;
194- $ filter ->process ($ request );
195- self ::assertEquals ($ initialState , $ state );
190+ // $filter = new ExpiryDate(self::$config, null);
191+ // $initialState = ["Attributes" =>
192+ // [
193+ // 'userPrincipalName' => ['test'],
194+ // 'accountExpires' => ['20231228112510Z'],
195+ // ],
196+ // ];
197+ // $request = array_merge(self::$minRequest, $initialState);
198+ // $state = $initialState;
199+ // $filter->process($request);
200+ // self::assertEquals($initialState, $state);
196201 }
197202}
0 commit comments