TestMessage.php 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. declare(strict_types=1);
  3. namespace TestApp\Mailer;
  4. use Cake\Mailer\Message;
  5. /**
  6. * Help to test Message
  7. */
  8. class TestMessage extends Message
  9. {
  10. /**
  11. * Wrap to protected method
  12. *
  13. * @return array
  14. */
  15. public function fmtAddress(array $address): array
  16. {
  17. return parent::formatAddress($address);
  18. }
  19. /**
  20. * Get the boundary attribute
  21. */
  22. public function getBoundary(): ?string
  23. {
  24. return $this->boundary;
  25. }
  26. /**
  27. * Encode to protected method
  28. */
  29. public function encode(string $text): string
  30. {
  31. return parent::encodeForHeader($text);
  32. }
  33. /**
  34. * Decode to protected method
  35. */
  36. public function decode(string $text): string
  37. {
  38. return parent::decodeForHeader($text);
  39. }
  40. /**
  41. * Wrap to protected method
  42. *
  43. * @return array
  44. */
  45. public function doWrap(string $text, int $length = Message::LINE_LENGTH_MUST): array
  46. {
  47. return $this->wrap($text, $length);
  48. }
  49. }