1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 00:24:02 +00:00

Use withtenantDatabases where needed

This commit is contained in:
lukinovec 2023-01-11 07:15:02 +01:00
parent cda2a57fb0
commit 23b028da36
5 changed files with 31 additions and 11 deletions

View file

@ -27,6 +27,8 @@ function assertMailerTransportUsesPassword(string|null $password) {
};
test('mailer transport uses the correct credentials', function() {
withTenantDatabases();
config(['mail.default' => 'smtp', 'mail.mailers.smtp.password' => $defaultPassword = 'DEFAULT']);
MailTenancyBootstrapper::$credentialsMap = ['mail.mailers.smtp.password' => 'smtp_password'];
@ -52,6 +54,8 @@ test('mailer transport uses the correct credentials', function() {
test('initializing and ending tenancy binds a fresh MailManager instance without cached mailers', function() {
withTenantDatabases();
$mailers = fn() => invade(app(MailManager::class))->mailers;
app(MailManager::class)->mailer('smtp');