diff --git a/Message/Mail/Email.php b/Message/Mail/Email.php index 2ed6e0306..c89221394 100644 --- a/Message/Mail/Email.php +++ b/Message/Mail/Email.php @@ -692,7 +692,7 @@ class Email implements MessageInterface : $this->messageDate->format('D, j M Y H:i:s O')) . self::$LE; - if ($this->mailer === SubmitType::MAIL) { + if ($this->mailer !== SubmitType::MAIL) { $result .= \count($this->to) > 0 ? $this->addrAppend('To', $this->to) : 'To: undisclosed-recipients:;' . self::$LE; @@ -706,7 +706,9 @@ class Email implements MessageInterface } // sendmail and mail() extract Bcc from the header before sending - if (($this->mailer === SubmitType::MAIL || $this->mailer === SubmitType::SENDMAIL || $this->mailer === SubmitType::QMAIL) + if (($this->mailer === SubmitType::MAIL + || $this->mailer === SubmitType::SENDMAIL + || $this->mailer === SubmitType::QMAIL) && \count($this->bcc) > 0 ) { $result .= $this->addrAppend('Bcc', $this->bcc); diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index 4fe49df1a..88095675c 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -437,7 +437,7 @@ final class ArrayUtils $diff = []; foreach ($values1 as $key => $value) { if (\is_array($value)) { - if (!array_key_exists($key, $values2) || !\is_array($values2[$key])) { + if (!\array_key_exists($key, $values2) || !\is_array($values2[$key])) { $diff[$key] = $value; } else { $subDiff = self::array_diff_assoc_recursive($value, $values2[$key]); diff --git a/tests/Message/Mail/MailHandlerTest.php b/tests/Message/Mail/MailHandlerTest.php index d89dae788..47c56d350 100644 --- a/tests/Message/Mail/MailHandlerTest.php +++ b/tests/Message/Mail/MailHandlerTest.php @@ -42,6 +42,20 @@ class MailHandlerTest extends \PHPUnit\Framework\TestCase self::assertTrue($mailer->send($mail)); } + public function testSendTextWithSendmail() : void + { + $mailer = new MailHandler(); + $mailer->setMailer(SubmitType::SENDMAIL); + + $mail = new Email(); + $mail->setFrom('dennis.eichhorn@orange-management.org', 'Dennis Eichhorn'); + $mail->addTo('info@orange-management.org', 'Dennis Eichhorn'); + $mail->subject = 'Test email'; + $mail->body = 'This is some content'; + + self::assertTrue($mailer->send($mail)); + } + public function testReceiveMailWithImap() : void {/* $mailer = new Imap(); diff --git a/tests/System/File/Local/DirectoryTest.php b/tests/System/File/Local/DirectoryTest.php index 9e670ced2..a10b17b0b 100644 --- a/tests/System/File/Local/DirectoryTest.php +++ b/tests/System/File/Local/DirectoryTest.php @@ -398,7 +398,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase { $dirTestPath = __DIR__ . '/dirtest'; self::assertCount(6, Directory::list($dirTestPath, '*', true)); - self::assertEquals(['sub/test2.txt', 'sub/test4.md', 'sub/path/test3.txt'], Directory::list($dirTestPath, 'test[0-9]+.*', true)); + self::assertEquals([], \array_diff(['sub/test2.txt', 'sub/test4.md', 'sub/path/test3.txt'], Directory::list($dirTestPath, 'test[0-9]+.*', true))); self::assertCount(2, Directory::list($dirTestPath, '*', false)); }