RenderedContentWithFrontMatterTest.php 992 B

1234567891011121314151617181920212223242526272829303132
  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\Extension\FrontMatter\Output;
  12. use League\CommonMark\Extension\FrontMatter\Output\RenderedContentWithFrontMatter;
  13. use League\CommonMark\Node\Block\Document;
  14. use PHPUnit\Framework\TestCase;
  15. final class RenderedContentWithFrontMatterTest extends TestCase
  16. {
  17. public function testConstructorAndGetters(): void
  18. {
  19. $document = new Document();
  20. $output = new RenderedContentWithFrontMatter($document, '<h1>Hello, World!</h1>', ['foo' => 'bar']);
  21. $this->assertSame($document, $output->getDocument());
  22. $this->assertSame('<h1>Hello, World!</h1>', $output->getContent());
  23. $this->assertSame(['foo' => 'bar'], $output->getFrontMatter());
  24. }
  25. }