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

Event listener arguments test

This commit is contained in:
Samuel Štancl 2019-10-27 20:45:12 +01:00
parent 8258cc0e03
commit 91b787d76f
2 changed files with 11 additions and 1 deletions

View file

@ -320,4 +320,14 @@ class TenantManagerTest extends TestCase
$this->expectException(TenantDoesNotExistException::class);
tenancy()->find('gjnfdgf');
}
/** @test */
public function event_listeners_can_accept_arguments()
{
tenancy()->hook('tenant.creating', function ($tenantManager, $tenant) {
$this->assertSame('bar', $tenant->foo);
});
Tenant::new()->withData(['foo' => 'bar'])->save();
}
}