1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 17:54:03 +00:00

Fix tests

This commit is contained in:
Samuel Štancl 2019-11-04 17:18:31 +01:00
parent 6ed68dfd7f
commit e67ce1a3d9
4 changed files with 24 additions and 3 deletions

View file

@ -334,6 +334,8 @@ class Tenant implements ArrayAccess
*/
public function put($key, $value = null): self
{
$this->manager->event('tenant.updating', $this);
if ($key === 'id') {
throw new TenantStorageException("Tenant ids can't be changed.");
}
@ -354,6 +356,8 @@ class Tenant implements ArrayAccess
$this->data[$key] = $value;
}
$this->manager->event('tenant.updated', $this);
return $this;
}
@ -382,6 +386,8 @@ class Tenant implements ArrayAccess
*/
public function deleteKeys(array $keys): self
{
$this->manager->event('tenant.updating', $this);
if (! $this->storage instanceof CanDeleteKeys) {
throw new NotImplementedException(get_class($this->storage), 'deleteMany',
'This method was added to storage drivers provided by the package in 2.2.0 and will be part of the StorageDriver contract in 3.0.0.'
@ -393,6 +399,8 @@ class Tenant implements ArrayAccess
}
}
$this->manager->event('tenant.updated', $this);
return $this;
}