SmartPunctXmlTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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\SmartPunct;
  12. use League\CommonMark\ConverterInterface;
  13. use League\CommonMark\Environment\Environment;
  14. use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
  15. use League\CommonMark\Extension\SmartPunct\SmartPunctExtension;
  16. use League\CommonMark\Tests\Functional\AbstractLocalDataTest;
  17. use League\CommonMark\Xml\MarkdownToXmlConverter;
  18. final class SmartPunctXmlTest extends AbstractLocalDataTest
  19. {
  20. /**
  21. * @param array<string, mixed> $config
  22. */
  23. protected function createConverter(array $config = []): ConverterInterface
  24. {
  25. $environment = new Environment($config);
  26. $environment->addExtension(new CommonMarkCoreExtension());
  27. $environment->addExtension(new SmartPunctExtension());
  28. return new MarkdownToXmlConverter($environment);
  29. }
  30. /**
  31. * {@inheritDoc}
  32. */
  33. public function dataProvider(): iterable
  34. {
  35. yield from $this->loadTests(__DIR__ . '/xml', '*', '.md', '.xml');
  36. }
  37. }