Skip to content

Commit

Permalink
Merge pull request #197 from cyklokoalicia/phpmailer_update
Browse files Browse the repository at this point in the history
Update phpmailer
  • Loading branch information
sveneld authored May 25, 2024
2 parents d26fb15 + 29162fc commit 81cea2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"require": {
"php": "^7.4",
"phpmailer/phpmailer": "^5.2.9",
"phpmailer/phpmailer": "^6.5.0",
"tecnickcom/tcpdf": "^6.2.6",
"ext-json": "*",
"ext-mysqli": "*",
Expand Down
8 changes: 5 additions & 3 deletions src/Mail/PHPMailerMailSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace BikeShare\Mail;

use PHPMailer\PHPMailer\PHPMailer;

class PHPMailerMailSender implements MailSenderInterface
{
/**
Expand All @@ -17,21 +19,21 @@ class PHPMailerMailSender implements MailSenderInterface
*/
private $emailConfig;
/**
* @var \PHPMailer
* @var PHPMailer
*/
private $mailer;

/**
* @param string $fromEmail
* @param string $fromName
* @param array $emailConfig
* @param \PHPMailer $mailer
* @param PHPMailer $mailer
*/
public function __construct(
$fromEmail,
$fromName,
array $emailConfig,
\PHPMailer $mailer
PHPMailer $mailer
) {
#todo add validation of incoming params and throw exception if not valid
$this->fromEmail = $fromEmail;
Expand Down
5 changes: 3 additions & 2 deletions tests/Mail/PHPMailerSenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace Test\BikeShare\Mail;

use BikeShare\Mail\PHPMailerMailSender;
use PHPMailer\PHPMailer\PHPMailer;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class PHPMailerSenderTest extends TestCase
{
/**
* @var \PHPMailer|MockObject
* @var PHPMailer|MockObject
*/
private $mailer;
/**
Expand All @@ -25,7 +26,7 @@ protected function setUp(): void
'pass' => 'pass',
];

$this->mailer = $this->createMock(\PHPMailer::class);
$this->mailer = $this->createMock(PHPMailer::class);
$this->mailSender = new PHPMailerMailSender(
'fromEmail',
'fromName',
Expand Down

0 comments on commit 81cea2e

Please sign in to comment.