TableMarkdownTest.php 1.3 KB

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