mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-16 10:29:16 +01:00
Add User & AuthLog equals() method for comparison during tests
This commit is contained in:
parent
a23be58ba9
commit
57d78a8675
@ -89,4 +89,19 @@ public function authenticatable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare 2 Authentications
|
||||
*/
|
||||
public function equals(self $other) : bool
|
||||
{
|
||||
return $this->ip_address === $other->ip_address &&
|
||||
$this->user_agent === $other->user_agent &&
|
||||
$this->login_at == $other->login_at &&
|
||||
$this->login_successful == $other->login_successful &&
|
||||
$this->logout_at == $other->logout_at &&
|
||||
$this->cleared_by_user == $other->cleared_by_user &&
|
||||
$this->guard == $other->guard &&
|
||||
$this->login_method == $other->login_method;
|
||||
}
|
||||
}
|
||||
|
@ -232,4 +232,16 @@ public function groups()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Group::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare 2 Users
|
||||
*/
|
||||
public function equals(self $other) : bool
|
||||
{
|
||||
return $this->name === $other->name &&
|
||||
$this->email === $other->email &&
|
||||
$this->oauth_id == $other->oauth_id &&
|
||||
$this->oauth_provider == $other->oauth_provider;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user