1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 19:14:04 +00:00

Fix some tests

This commit is contained in:
Samuel Štancl 2019-09-16 17:36:32 +02:00
parent 93d2a281eb
commit 50a77ee826
10 changed files with 76 additions and 61 deletions

View file

@ -77,6 +77,11 @@ class Tenant implements ArrayAccess
return static::new()->withData($data)->persisted(true);
}
public static function create($domains, array $data = []): self
{
return static::new()->withDomains((array) $domains)->withData($data)->save();
}
protected function persisted($persisted = null)
{
if (gettype($persisted) === 'bool') {
@ -132,7 +137,7 @@ class Tenant implements ArrayAccess
return $this;
}
public function withData($data): self
public function withData(array $data): self
{
$this->data = $data;
@ -234,7 +239,7 @@ class Tenant implements ArrayAccess
public function put($key, $value = null): self
{
if ($this->storage->getIdKey() === $key) {
if ($key === 'id') {
throw new TenantStorageException("The tenant's id can't be changed.");
}