RenderedContentTest.php 1002 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. * This file is part of the league/commonmark package.
  4. *
  5. * (c) Colin O'Dell <colinodell@gmail.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. declare(strict_types=1);
  11. namespace League\CommonMark\Tests\Unit\Output;
  12. use League\CommonMark\Node\Block\Document;
  13. use League\CommonMark\Output\RenderedContent;
  14. use PHPUnit\Framework\TestCase;
  15. final class RenderedContentTest extends TestCase
  16. {
  17. public function testEverything(): void
  18. {
  19. $document = $this->createMock(Document::class);
  20. $html = '<h1>Hello World!</h1>';
  21. $object = new RenderedContent($document, $html);
  22. $this->assertInstanceOf(\Stringable::class, $object);
  23. $this->assertSame($document, $object->getDocument());
  24. $this->assertSame($html, $object->getContent());
  25. $this->assertSame($html, $object->__toString());
  26. $this->assertSame($html, (string) $object);
  27. }
  28. }