Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RawMessageTest.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Mime\Tests;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\Mime\RawMessage;
  13. class RawMessageTest extends TestCase
  14. {
  15. public function testToString()
  16. {
  17. $message = new RawMessage('string');
  18. $this->assertEquals('string', $message->toString());
  19. $this->assertEquals('string', implode('', iterator_to_array($message->toIterable())));
  20. // calling methods more than once work
  21. $this->assertEquals('string', $message->toString());
  22. $this->assertEquals('string', implode('', iterator_to_array($message->toIterable())));
  23. $message = new RawMessage(new \ArrayObject(['some', ' ', 'string']));
  24. $this->assertEquals('some string', $message->toString());
  25. $this->assertEquals('some string', implode('', iterator_to_array($message->toIterable())));
  26. // calling methods more than once work
  27. $this->assertEquals('some string', $message->toString());
  28. $this->assertEquals('some string', implode('', iterator_to_array($message->toIterable())));
  29. }
  30. }