Compare commits
No commits in common. 'master' and 'v1.1.0' have entirely different histories.
11 changed files with 15 additions and 301 deletions
@ -1,70 +0,0 @@ |
|||||||
<?php declare(strict_types=1); |
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase; |
|
||||||
|
|
||||||
final class AnnotationsTest extends TestCase { |
|
||||||
public function testAnnotationsDoNotBreakHeadings() : void { |
|
||||||
$source = " |
|
||||||
# This is an H1 {.withAClass} |
|
||||||
## This is an H2 {.withAClass} |
|
||||||
### This is an H3 {.withAClass} |
|
||||||
#### This is an H4 {.withAClass} |
|
||||||
##### This is an H5 {.withAClass} |
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<h1>This is an H1</h1> |
|
||||||
<h2>This is an H2</h2> |
|
||||||
<h3>This is an H3</h3> |
|
||||||
<h4>This is an H4</h4> |
|
||||||
<h5>This is an H5</h5> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
|
|
||||||
public function testAnnotationsDoNotBreakLists() : void { |
|
||||||
$source = " |
|
||||||
|
|
||||||
* this is a list |
|
||||||
* with annotations {#someID} |
|
||||||
|
|
||||||
1. this is an ordered list |
|
||||||
1. with an annotation {.someClass} |
|
||||||
|
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<ul> |
|
||||||
<li>this is a list</li> |
|
||||||
<li>with annotations</li> |
|
||||||
</ul> |
|
||||||
<ol> |
|
||||||
<li> |
|
||||||
this is an ordered list |
|
||||||
<ol> |
|
||||||
<li>with an annotation</li> |
|
||||||
</ol> |
|
||||||
</li> |
|
||||||
</ol> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
|
|
||||||
public function testAnnotationsDoNotBreakCodeblocks() : void { |
|
||||||
$source = " |
|
||||||
``` |
|
||||||
this is a code block |
|
||||||
``` {.someClass} |
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<pre> |
|
||||||
<code>this is a code block</code> |
|
||||||
</pre> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
} |
|
@ -1,65 +0,0 @@ |
|||||||
<?php declare(strict_types=1); |
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase; |
|
||||||
|
|
||||||
final class HeadingsTest extends TestCase { |
|
||||||
public function testH1ParsesCorrectly() : void { |
|
||||||
$source = " |
|
||||||
# This is an H1 |
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<h1>This is an H1</h1> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
|
|
||||||
public function testH2ParsesCorrectly() : void { |
|
||||||
$source = " |
|
||||||
## This is an H2 |
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<h2>This is an H2</h2> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
|
|
||||||
public function testH3ParsesCorrectly() : void { |
|
||||||
$source = " |
|
||||||
### This is an H3 |
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<h3>This is an H3</h3> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
|
|
||||||
public function testH4ParsesCorrectly() : void { |
|
||||||
$source = " |
|
||||||
#### This is an H4 |
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<h4>This is an H4</h4> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
|
|
||||||
public function testH5ParsesCorrectly() : void { |
|
||||||
$source = " |
|
||||||
##### This is an H5 |
|
||||||
"; |
|
||||||
$target = " |
|
||||||
<h5>This is an H5</h5> |
|
||||||
"; |
|
||||||
|
|
||||||
[$source, $result] = createTest($source, $target); |
|
||||||
$this->assertEquals($source, $result); |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue