NotificationMessageTest.php 956 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Illuminate\Tests\Notifications;
  3. use Illuminate\Notifications\Messages\SimpleMessage as Message;
  4. use PHPUnit\Framework\TestCase;
  5. class NotificationMessageTest extends TestCase
  6. {
  7. public function testLevelCanBeRetrieved()
  8. {
  9. $message = new Message;
  10. $this->assertSame('info', $message->level);
  11. $message = new Message;
  12. $message->level('error');
  13. $this->assertSame('error', $message->level);
  14. }
  15. public function testMessageFormatsMultiLineText()
  16. {
  17. $message = new Message;
  18. $message->with('
  19. This is a
  20. single line of text.
  21. ');
  22. $this->assertSame('This is a single line of text.', $message->introLines[0]);
  23. $message = new Message;
  24. $message->with([
  25. 'This is a',
  26. 'single line of text.',
  27. ]);
  28. $this->assertSame('This is a single line of text.', $message->introLines[0]);
  29. }
  30. }