diff --git a/tests/Unit/Service/TrustedCookie/DateTime/ExpirationHelperTest.php b/tests/Unit/Service/TrustedCookie/DateTime/ExpirationHelperTest.php index 394fbdfd..f8104ce8 100644 --- a/tests/Unit/Service/TrustedCookie/DateTime/ExpirationHelperTest.php +++ b/tests/Unit/Service/TrustedCookie/DateTime/ExpirationHelperTest.php @@ -36,13 +36,22 @@ public function test_is_expired(bool $isExpired, ExpirationHelper $helper, Cooki } /** - * @dataProvider gracePeriodExpectations + * @dataProvider expirationValues */ - public function test_grace_period(bool $isExpired, ExpirationHelper $helper, CookieValue $cookieValue): void + public function test_expiration_period(bool $isExpired, ExpirationHelper $helper, CookieValue $cookieValue): void { self::assertEquals($isExpired, $helper->isExpired($cookieValue)); } + public function expirationValues(): array + { + // Cookie lifetime 3600 + $helper = $this->makeExpirationHelper(3600, time()); + return [ + 'within period' => [false, $helper, $this->makeCookieValue(time() - 3600)], + 'outside period' => [true, $helper, $this->makeCookieValue(time() - 3601)], + ]; + } public function invalidTimeExpectations(): array { @@ -97,16 +106,6 @@ public function expirationExpectations(): array ]; } - public function gracePeriodExpectations(): array - { - // Cookie lifetime 3600 - $helper = $this->makeExpirationHelper(3600, time()); - return [ - 'within grace period (lower bound)' => [false, $helper, $this->makeCookieValue(time() - 3600)], - 'outside grace period' => [true, $helper, $this->makeCookieValue(time() - 3601)], - ]; - } - private function makeExpirationHelper(int $expirationTime, int $now) : ExpirationHelper { $time = new \DateTime();