public function testMarkdownDisabledButForced() { Config::set('letterpress.markdown.enabled', false); $actual = '# This will be processed'; $expected = '<h1>This will be processed</h1>'; $this->assertEquals($expected, Markdown::run($actual, true)); }
/** * @expectedException EFrane\Letterpress\LetterpressException * @expectedExceptionMessage Typography fixing requires setting up fixers. */ public function testInstantiateFailsWithoutFixers() { Config::set('jolitypo.defaults', []); Config::set('jolitypo.en_GB', []); Config::set('letterpress.microtypography.enableHyphenation', false); new TypoFixerFacade(); }
public function setUp() { parent::setUp(); Config::init(); Config::set('letterpress.media.enabled', false); $this->processor = new MarkupProcessor(); $this->setUnitUnderTest(); }
public function testLoadsLanguageCodeModifier() { Config::set('letterpress.markup.addLanguageInfo', true); $modifiers = $this->getModifierClassNames(new MarkupProcessor(new Repository())); $this->assertContains(BlockQuoteModifier::class, $modifiers); $this->assertContains(RemoveEmptyNodesModifier::class, $modifiers); $this->assertContains(LanguageCodeModifier::class, $modifiers); }
/** * @dataProvider lineBreaksData */ public function testLineBreaks($enabled, $actual, $expected) { Config::set('letterpress.markdown.enableLineBreaks', $enabled); $instance = ParsedownFactory::create(); $this->assertEquals($expected, $instance->text($actual)); }