mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-24 16:09:14 +01:00
Fix tests
This commit is contained in:
parent
178dba6a03
commit
9e13cc927f
@ -544,9 +544,8 @@ public function test_demote_the_only_admin_returns_forbidden() : void
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function test_authentications_returns_all_entries() : void
|
||||
public function test_authentications_returns_all_preserved_entries() : void
|
||||
{
|
||||
AuthLog::factory()->for($this->user, 'authenticatable')->beforeLastYear()->create();
|
||||
AuthLog::factory()->for($this->user, 'authenticatable')->duringLastYear()->create();
|
||||
AuthLog::factory()->for($this->user, 'authenticatable')->duringLastSixMonth()->create();
|
||||
AuthLog::factory()->for($this->user, 'authenticatable')->duringLastThreeMonth()->create();
|
||||
@ -558,7 +557,20 @@ public function test_authentications_returns_all_entries() : void
|
||||
$this->actingAs($this->admin, 'api-guard')
|
||||
->json('GET', '/api/v1/users/' . $this->user->id . '/authentications')
|
||||
->assertOk()
|
||||
->assertJsonCount(8);
|
||||
->assertJsonCount(7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function test_authentications_does_not_return_old_entries() : void
|
||||
{
|
||||
AuthLog::factory()->for($this->user, 'authenticatable')->beforeLastYear()->create();
|
||||
|
||||
$this->actingAs($this->admin, 'api-guard')
|
||||
->json('GET', '/api/v1/users/' . $this->user->id . '/authentications')
|
||||
->assertOk()
|
||||
->assertJsonCount(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user