Skip to content

Commit 91c0025

Browse files
committed
added tests
1 parent 164bce4 commit 91c0025

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tests/Authentication/Filters/AbstractFilterTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static function ($routes): void {
6969
echo 'Open';
7070
});
7171
$routes->get('login', 'AuthController::login', ['as' => 'login']);
72+
$routes->get('auth/a/show', 'AuthActionController::show', ['as' => 'auth-action-show']);
7273
$routes->get('protected-user-route', static function (): void {
7374
echo 'Protected';
7475
}, ['filter' => $this->alias . ':users-read']);

tests/Authentication/Filters/SessionFilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testRecordActiveDate(): void
5858
$this->assertGreaterThan(auth('session')->user()->updated_at, auth('session')->user()->last_active);
5959
}
6060

61-
public function testBlocksInactiveUsers(): void
61+
public function testBlocksInactiveUsersAndRedirectsToAuthAction(): void
6262
{
6363
$user = fake(UserModel::class, ['active' => false]);
6464

@@ -77,7 +77,7 @@ public function testBlocksInactiveUsers(): void
7777
$result = $this->actingAs($user)
7878
->get('protected-route');
7979

80-
$result->assertRedirectTo('/login');
80+
$result->assertRedirectTo('/auth/a/show');
8181
// User should be logged out
8282
$this->assertNull(auth('session')->id());
8383

0 commit comments

Comments
 (0)