File tree Expand file tree Collapse file tree
tests/lib/MVC/Symfony/FieldType/User Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,12 +44,8 @@ protected function setUp(): void
4444 $ this ->parameterProvider = new ParameterProvider ($ this ->userService );
4545 }
4646
47- /**
48- * @requires PHP < 8.1
49- */
5047 public function testGetViewParameters (): void
5148 {
52- $ passwordExpiresIn = 14 ;
5349 $ passwordExpiresAt = (new DateTimeImmutable ())->add (new DateInterval ('P14D ' ));
5450
5551 $ this ->userService
@@ -63,7 +59,9 @@ public function testGetViewParameters(): void
6359
6460 self ::assertFalse ($ parameters ['is_password_expired ' ]);
6561 self ::assertEquals ($ passwordExpiresAt , $ parameters ['password_expires_at ' ]);
66- self ::assertEquals ($ passwordExpiresIn , $ parameters ['password_expires_in ' ]->days );
62+ // since PHP 8.1 computing date time includes microseconds, so the difference is not deterministic
63+ self ::assertGreaterThanOrEqual (13 , $ parameters ['password_expires_in ' ]->days );
64+ self ::assertLessThanOrEqual (14 , $ parameters ['password_expires_in ' ]->days );
6765 }
6866
6967 public function testGetViewParametersWhenPasswordExpirationDateIsNull (): void
You can’t perform that action at this time.
0 commit comments