Updated API test fixtures to include API keys with roles

This commit is contained in:
Alejandro Celaya
2021-01-10 08:40:18 +01:00
parent 380915948b
commit f827186c77
5 changed files with 57 additions and 19 deletions

View File

@@ -45,6 +45,14 @@ class ApiKey extends AbstractEntity
return $apiKey;
}
public static function withKey(string $key, ?Chronos $expirationDate = null): self
{
$apiKey = new self($expirationDate);
$apiKey->key = $key;
return $apiKey;
}
public function getExpirationDate(): ?Chronos
{
return $this->expirationDate;