mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:34:04 +00:00
Use invade() instead of ReflectionClass
This commit is contained in:
parent
b96ff262ef
commit
b3cef0c100
1 changed files with 2 additions and 8 deletions
|
|
@ -36,14 +36,8 @@ test('SMTP mailer transport uses the correct tenant credentials', function() {
|
|||
|
||||
$manager = app(MailManager::class);
|
||||
|
||||
$getMailerViaManager = new ReflectionMethod($manager::class, 'get');
|
||||
$getMailerViaManager->setAccessible(true);
|
||||
$mailer = $getMailerViaManager->invoke($manager, 'smtp');
|
||||
|
||||
$transportReflection = new ReflectionClass($transport = $mailer->getSymfonyTransport());
|
||||
$transportPassword = $transportReflection->getProperty('password');
|
||||
$transportPassword->setAccessible(true);
|
||||
$mailerPassword = $transportPassword->getValue($transport);
|
||||
$mailer = invade($manager)->get('smtp');
|
||||
$mailerPassword = invade($mailer->getSymfonyTransport())->password;
|
||||
|
||||
expect($mailerPassword)->toBe((string) $password);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue