From 13b1150922c2a4ae01c780e8406ad8336b471573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Tue, 5 Dec 2023 02:21:49 +0100 Subject: [PATCH] Requires orisai/clock:^1.2.0 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- tests/Unit/Authentication/BaseFirewallTest.php | 8 ++++---- tools/phpstan.baseline.neon | 5 +++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b975af..7898726 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased](https://github.com/orisai/auth/compare/2.0.1...v2.x) +### Changed + +- Requires `orisai/clock:^1.2.0` + ## [2.0.1](https://github.com/orisai/auth/compare/2.0.0...2.0.1) - 2023-10-18 ### Changed diff --git a/composer.json b/composer.json index c18003c..65b05d3 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ ], "require": { "php": ">=7.4.0 <8.3.0", - "orisai/clock": "^1.1.0", + "orisai/clock": "^1.2.0", "orisai/exceptions": "^1.0.0", "orisai/translation-contracts": "^1.1.0", "orisai/utils": "^1.0.0", diff --git a/tests/Unit/Authentication/BaseFirewallTest.php b/tests/Unit/Authentication/BaseFirewallTest.php index b9a3ac9..1d3ffb8 100644 --- a/tests/Unit/Authentication/BaseFirewallTest.php +++ b/tests/Unit/Authentication/BaseFirewallTest.php @@ -444,7 +444,7 @@ public function testTimeExpiredIdentity(): void $firewall->setExpirationTime($clock->now()->modify('+1 second')); self::assertSame($identity, $firewall->getIdentity()); - $clock->move(2); + $clock->sleep(2); $firewall->resetLoginsChecks(); self::assertFalse($firewall->isLoggedIn()); @@ -470,7 +470,7 @@ public function testNotTimeExpiredIdentity(): void $firewall->setExpirationTime($clock->now()->modify('+1 second')); self::assertSame($identity, $firewall->getIdentity()); - $clock->move(1); + $clock->sleep(1); $firewall->resetLoginsChecks(); self::assertTrue($firewall->isLoggedIn()); @@ -490,7 +490,7 @@ public function testRemovedTimeExpiration(): void $firewall->removeExpirationTime(); self::assertSame($identity, $firewall->getIdentity()); - $clock->move(2); + $clock->sleep(2); $firewall->resetLoginsChecks(); self::assertSame($identity, $firewall->getIdentity()); @@ -583,7 +583,7 @@ public function testGetExpirationTime(): void self::assertSame(5, $expirationTime->getTimestamp()); $firewall->resetLoginsChecks(); - $clock->move(1); + $clock->sleep(1); $expirationTime = $firewall->getExpirationTime(); self::assertNotNull($expirationTime); self::assertSame(6, $expirationTime->getTimestamp()); diff --git a/tools/phpstan.baseline.neon b/tools/phpstan.baseline.neon index 49e4f37..04d10c6 100644 --- a/tools/phpstan.baseline.neon +++ b/tools/phpstan.baseline.neon @@ -4,3 +4,8 @@ parameters: message: "#^Parameter \\#1 \\$id of class Orisai\\\\TranslationContracts\\\\TranslatableMessage constructor expects literal\\-string, mixed given\\.$#" count: 1 path: ../src/Authentication/Data/ExpiredLogin.php + + - + message: "#^Parameter \\#1 \\$timestamp of class Orisai\\\\Clock\\\\FrozenClock constructor expects DateTimeInterface\\|float, int\\<1, max\\> given\\.$#" + count: 3 + path: ../tests/Unit/Authentication/BaseFirewallTest.php