diff --git a/Tests/FeatureTest.php b/Tests/FeatureTest.php index 4581b35..7c0d099 100644 --- a/Tests/FeatureTest.php +++ b/Tests/FeatureTest.php @@ -749,31 +749,15 @@ That's some text with a footnote.[^1] [^1]: And that's the footnote. EOF; - $html = <<That's some text with a footnote.1

- -
-
-
    - -
  1. -

    And that's the footnote. ↩︎

    -
  2. - -
-
- -EOF; - - // newer versions of Michelf add an extra ︎ To make the tests - // pass against ALL versions, we just hack the ︎ into the - // expected string if it isn't there $actualHtml = $parser->transform($text); - if (strpos($actualHtml, '︎') === false) { - $actualHtml = str_replace('↩', '↩︎', $actualHtml); - } - $this->assertEquals($html, $actualHtml); + // asserting a few things instead of comparing full final HTML + // because a few minor things have changed over versions of Michelf + // With assertContains(), tests will pass across all versions + $this->assertContains('

That\'s some text with a footnote.assertContains('

assertContains('
  • assertContains('

    And that\'s the footnote. transform('*hi*', 'light'); $this->assertEquals("

    hi

    \n", $actual, 'Specific parsers are registered'); - - /** @var MarkdownHelper $markdownHelper */ - $markdownHelper = $container->get('templating.helper.markdown'); - $actual = $markdownHelper->transform('*yo*'); - $this->assertEquals("

    yo

    \n", $actual, 'The templating helper also works'); } } diff --git a/Tests/fixtures/app/TestKernel.php b/Tests/fixtures/app/TestKernel.php index fd00ecf..b5cb93d 100644 --- a/Tests/fixtures/app/TestKernel.php +++ b/Tests/fixtures/app/TestKernel.php @@ -5,6 +5,7 @@ namespace Knp\Bundle\MarkdownBundle\Tests\fixtures\app; use Knp\Bundle\MarkdownBundle\KnpMarkdownBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\Kernel; @@ -27,7 +28,7 @@ class TestKernel extends Kernel )); // add a public alias so we can fetch for testing - $c->setAlias('markdown.parser.parser_manager.public', 'markdown.parser.parser_manager'); + $c->setAlias('markdown.parser.parser_manager.public', new Alias('markdown.parser.parser_manager', true)); }); } } \ No newline at end of file