From 2eeb4c533b74e47235efcf1cf5c809843fe6dbe2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 21 Mar 2023 22:39:43 +0100 Subject: [PATCH] Add additional tests for proof --- ...aticSiteBuilderDocumentationModuleTest.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php b/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php index 80110b8a555..89e7958ce79 100644 --- a/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php +++ b/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php @@ -83,6 +83,9 @@ public function test_can_compile_page_with_atx_headers() MARKDOWN ); + $this->page->save(); + $this->cleanUpWhenDone($this->page->getSourcePath()); + $this->inspectHtml([ 'Adventures in Wonderland', '

CHAPTER I. DOWN THE RABBIT-HOLE.

', @@ -90,6 +93,30 @@ public function test_can_compile_page_with_atx_headers() ]); } + public function test_can_compile_page_to_root_output_directory_with_atx_headers() + { + DocumentationPage::setOutputDirectory(''); + + $this->page = DocumentationPage::make('test-page', markdown: <<<'MARKDOWN' + # Adventures in Wonderland + + ## CHAPTER I. DOWN THE RABBIT-HOLE. + + So she was considering in her own mind, as well as she could, for the hot day made her feel very sleepy and stupid. + + MARKDOWN + ); + + $this->page->save(); + $this->cleanUpWhenDone($this->page->getSourcePath()); + + $this->inspectHtml([ + 'Adventures in Wonderland', + '

CHAPTER I. DOWN THE RABBIT-HOLE.

', + '

So she was considering in her own mind, as well as she could', + ], '_site/test-page.html'); + } + public function test_can_compile_page_with_setext_headers() { $this->page = DocumentationPage::make('test-page', markdown: <<<'MARKDOWN'