Skip to content

Commit

Permalink
Requires orisai/clock:^1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Dec 5, 2023
1 parent df14fa4 commit 13b1150
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Authentication/BaseFirewallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
5 changes: 5 additions & 0 deletions tools/phpstan.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 13b1150

Please sign in to comment.