Add User & AuthLog equals() method for comparison during tests

This commit is contained in:
Bubka
2024-07-03 11:09:44 +02:00
parent a23be58ba9
commit 57d78a8675
2 changed files with 27 additions and 0 deletions

View File

@@ -232,4 +232,16 @@ class User extends Authenticatable implements HasLocalePreference, WebAuthnAuthe
{
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;
}
}