From a432b13039422ae72aa5bce2ec6dc96630a043ae Mon Sep 17 00:00:00 2001 From: Josh Kadis Date: Wed, 21 Dec 2016 13:15:48 -0500 Subject: [PATCH] add markdownify and basic unit tests for YAML and Markdown output --- .gitmodules | 3 +++ Markdownify | 1 + command.php | 4 ++++ tests/test-dependencies.php | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 .gitmodules create mode 160000 Markdownify create mode 100644 tests/test-dependencies.php diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..693fe54 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Markdownify"] + path = Markdownify + url = git@github.com:Elephant418/Markdownify.git diff --git a/Markdownify b/Markdownify new file mode 160000 index 0000000..0160677 --- /dev/null +++ b/Markdownify @@ -0,0 +1 @@ +Subproject commit 0160677f04c784550dd10fd72fdf3994967db848 diff --git a/command.php b/command.php index 0c79cf3..56260cf 100644 --- a/command.php +++ b/command.php @@ -1,5 +1,9 @@ assertTrue( function_exists( 'yaml_emit' ) ); + $this->assertTrue( class_exists( '\\Markdownify\\ConverterExtra' ) ); + } + + function test_basic() { + // Basic Markdownify functionality + $converter = new Markdownify\ConverterExtra; + $markdown = $converter->parseString('

Test

'); + $this->assertEquals( '# Test', $markdown ); + + // Basic YAML output + $yaml = yaml_emit( array( 'test' => 'test output', 'foo' => array( 'bar' ) ) ); + $this->assertEquals( $yaml, "---\ntest: test output\nfoo:\n- bar\n...\n" ); + } +}