GithubFlavoredMarkdownExtensionTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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;
  12. use League\CommonMark\GithubFlavoredMarkdownConverter;
  13. use League\CommonMark\Tests\Functional\AbstractSpecTest;
  14. final class GithubFlavoredMarkdownExtensionTest extends AbstractSpecTest
  15. {
  16. protected function setUp(): void
  17. {
  18. $this->converter = new GithubFlavoredMarkdownConverter();
  19. }
  20. protected function getFileName(): string
  21. {
  22. return __DIR__ . '/../../../vendor/github/gfm/test/spec.txt';
  23. }
  24. public function dataProvider(): \Generator
  25. {
  26. foreach ($this->loadSpecExamples() as $title => $data) {
  27. // In the GFM spec, standard CommonMark tests are tagged 'example'
  28. // and we don't want to test those (because we test those against the
  29. // official CommonMark spec), but we DO want to test the GFM-specific ones
  30. // which will be tagged something like 'example autolink'
  31. if ($data['type'] !== 'example') {
  32. yield $title => $data;
  33. }
  34. }
  35. }
  36. }