CommonMarkXmlTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the league/commonmark package.
  5. *
  6. * (c) Colin O'Dell <colinodell@gmail.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace League\CommonMark\Tests\Functional\Extension\CommonMark;
  12. use League\CommonMark\ConverterInterface;
  13. use League\CommonMark\Environment\Environment;
  14. use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
  15. use League\CommonMark\Tests\Functional\AbstractLocalDataTest;
  16. use League\CommonMark\Xml\MarkdownToXmlConverter;
  17. final class CommonMarkXmlTest extends AbstractLocalDataTest
  18. {
  19. /**
  20. * @param array<string, mixed> $config
  21. */
  22. protected function createConverter(array $config = []): ConverterInterface
  23. {
  24. $environment = new Environment($config);
  25. $environment->addExtension(new CommonMarkCoreExtension());
  26. return new MarkdownToXmlConverter($environment);
  27. }
  28. /**
  29. * {@inheritDoc}
  30. */
  31. public function dataProvider(): iterable
  32. {
  33. yield from $this->loadTests(__DIR__ . '/xml', '*', '.md', '.xml');
  34. }
  35. }