From e83231ad1d1ab2853f45aca0e724b1c916575e15 Mon Sep 17 00:00:00 2001 From: Jason Ng <116290832+jason490@users.noreply.github.com> Date: Sun, 19 Nov 2023 22:12:47 -0500 Subject: [PATCH] Removed unneeded tests --- .../GithubMarkdownEngineTest.php | 50 --------------- .../MarkdownEngine/ParsedownEngineTest.php | 61 ------------------- .../PHPLeagueMarkdownEngineTest.php | 6 +- .../TokenParser/MarkdownTokenParserTest.php | 4 +- 4 files changed, 5 insertions(+), 116 deletions(-) delete mode 100644 tests/Submitty/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php delete mode 100644 tests/Submitty/Twig/Extension/MarkdownEngine/ParsedownEngineTest.php rename tests/Submitty/Twig/Extension/{MarkdownEngine => }/PHPLeagueMarkdownEngineTest.php (68%) diff --git a/tests/Submitty/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php b/tests/Submitty/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php deleted file mode 100644 index 91c59a7..0000000 --- a/tests/Submitty/Twig/Extension/MarkdownEngine/GithubMarkdownEngineTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ -class GitHubMarkdownEngineTest extends MarkdownExtensionTest -{ - /** - * @dataProvider getParseMarkdownTests - */ - public function testParseMarkdown($template, $expected, $context = array()) - { - try { - $this->assertEquals($expected, $this->getTemplate($template)->render($context)); - } catch (\Exception $e) { - $this->markTestSkipped($e->getMessage()); - } - } - - public function getParseMarkdownTests() - { - return array( - array('{{ "# Main Title"|markdown }}', '
TestTestxss
', $twig->load('index')->render()); - - $engine->setSafeMode(true); - $this->assertEquals('Test<em>Test</em>xss
', $twig->load('index')->render()); - $engine->setSafeMode(false); - } - - public function testMarkupEscape() - { - $engine = $this->getEngine(); - $loader = new \Twig\Loader\ArrayLoader(array('index' => '{{ "_Test_Test[xss](javascript:alert%281%29)"|markdown }}')); - $twig = new \Twig\Environment($loader, array('debug' => true, 'cache' => false)); - $twig->addExtension(new MarkdownExtension($engine)); - - $this->assertEquals('TestTestxss
', $twig->load('index')->render()); - - $engine->setMarkupEscaped(true); - $this->assertEquals('Test<em>Test</em>xss
', $twig->load('index')->render()); - $engine->setMarkupEscaped(false); - } -} diff --git a/tests/Submitty/Twig/Extension/MarkdownEngine/PHPLeagueMarkdownEngineTest.php b/tests/Submitty/Twig/Extension/PHPLeagueMarkdownEngineTest.php similarity index 68% rename from tests/Submitty/Twig/Extension/MarkdownEngine/PHPLeagueMarkdownEngineTest.php rename to tests/Submitty/Twig/Extension/PHPLeagueMarkdownEngineTest.php index 351d639..c62cda5 100644 --- a/tests/Submitty/Twig/Extension/MarkdownEngine/PHPLeagueMarkdownEngineTest.php +++ b/tests/Submitty/Twig/Extension/PHPLeagueMarkdownEngineTest.php @@ -5,16 +5,16 @@ use Submitty\Twig\Extension\MarkdownExtensionTest; // Require parent class if not autoloaded -if (!class_exists('\Aptoma\Twig\Extension\MarkdownExtensionTest')) { +if (!class_exists('\Submitty\Twig\Extension\MarkdownExtensionTest')) { require_once(__DIR__ . '/../MarkdownExtensionTest.php'); } /** - * Class PHPLeagueCommonMarkEngineTest + * Class PHPLeagueMarkdownEngineTest * * @author Casey McLaughlin