FootnoteExtensionXmlTest.php 1.3 KB

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