mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 23:14:04 +00:00
Clean up global state (static properties) in before/afterEach
This commit is contained in:
parent
52d10d36f9
commit
53b2181779
5 changed files with 30 additions and 5 deletions
|
|
@ -12,11 +12,16 @@ use Stancl\Tenancy\Bootstrappers\MailTenancyBootstrapper;
|
|||
|
||||
beforeEach(function() {
|
||||
config(['mail.default' => 'smtp']);
|
||||
MailTenancyBootstrapper::$credentialsMap = [];
|
||||
|
||||
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
|
||||
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
MailTenancyBootstrapper::$credentialsMap = [];
|
||||
});
|
||||
|
||||
// Initialize tenancy as $tenant and assert that the smtp mailer's transport has the correct password
|
||||
function assertMailerTransportUsesPassword(string|null $password) {
|
||||
$manager = app(MailManager::class);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue