FootnoteExtensionMarkdownTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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\MarkdownConverter;
  18. use League\CommonMark\Tests\Functional\AbstractLocalDataTest;
  19. /**
  20. * Test with minimal extensions
  21. */
  22. final class FootnoteExtensionMarkdownTest extends AbstractLocalDataTest
  23. {
  24. /**
  25. * @param array<string, mixed> $config
  26. */
  27. protected function createConverter(array $config = []): ConverterInterface
  28. {
  29. $environment = new Environment($config);
  30. $environment->addExtension(new CommonMarkCoreExtension());
  31. $environment->addExtension(new FootnoteExtension());
  32. return new MarkdownConverter($environment);
  33. }
  34. /**
  35. * {@inheritDoc}
  36. */
  37. public function dataProvider(): iterable
  38. {
  39. yield from $this->loadTests(__DIR__ . '/md');
  40. }
  41. }