Skip to content

Commit

Permalink
Add tests for #1337
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 21, 2023
1 parent 705c3a7 commit 65afc73
Showing 1 changed file with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,67 @@ public function test_can_compile_page_to_root_output_directory()
'<p>So she was considering in her own mind, as well as she could',
], '_site/test-page.html');
}

public function test_can_compile_page_with_atx_headers()
{
$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->inspectHtml([
'Adventures in Wonderland',
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
'<p>So she was considering in her own mind, as well as she could',
]);
}

public function test_can_compile_page_with_setext_headers()
{
$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->inspectHtml([
'Adventures in Wonderland',
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
'<p>So she was considering in her own mind, as well as she could',
]);
}

public function test_can_compile_page_to_root_output_directory_with_setext_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->inspectHtml([
'Adventures in Wonderland',
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
'<p>So she was considering in her own mind, as well as she could',
], '_site/test-page.html');
}
}

0 comments on commit 65afc73

Please sign in to comment.