TestMailer.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  5. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  6. *
  7. * Licensed under The MIT License
  8. * For full copyright and license information, please see the LICENSE.txt
  9. * Redistributions of files must retain the above copyright notice
  10. *
  11. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  12. * @link https://cakephp.org CakePHP(tm) Project
  13. * @since 3.1.0
  14. * @license https://opensource.org/licenses/mit-license.php MIT License
  15. */
  16. namespace TestApp\Mailer;
  17. use Cake\Mailer\Mailer;
  18. /**
  19. * Test Suite Test App Mailer class.
  20. */
  21. class TestMailer extends Mailer
  22. {
  23. protected $messageClass = TestMessage::class;
  24. public $boundary = null;
  25. public function deliver(string $content = ''): array
  26. {
  27. $result = parent::deliver($content);
  28. $this->boundary = $this->message->getBoundary();
  29. return $result;
  30. }
  31. public function send(?string $action = null, array $args = [], array $headers = []): array
  32. {
  33. $result = parent::send($action, $args, $headers);
  34. $this->boundary = $this->message->getBoundary();
  35. return $result;
  36. }
  37. }