You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
927 B
38 lines
927 B
<?php declare(strict_types=1);
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class ReferencesTest extends TestCase {
|
|
public function testSimpleReferencesAreResolvedCorrectly() : void {
|
|
$source = "
|
|
this text uses [a simple reference][1]
|
|
|
|
[1]: https://massivedynamic.eu
|
|
";
|
|
$target = "
|
|
<p>
|
|
this text uses <a href=\"https://massivedynamic.eu\">a simple reference</a>
|
|
</p>
|
|
";
|
|
|
|
[$source, $result] = createTest($source, $target);
|
|
$this->assertEquals($source, $result);
|
|
}
|
|
|
|
public function testNamedReferencesAreResolvedCorrectly() : void {
|
|
$source = "
|
|
this text uses [a simple reference][REF] and does it [twice][REF]
|
|
|
|
[REF]: https://massivedynamic.eu
|
|
";
|
|
$target = "
|
|
<p>
|
|
this text uses <a href=\"https://massivedynamic.eu\">a simple reference</a>
|
|
and does it <a href=\"https://massivedynamic.eu\">twice</a>
|
|
</p>
|
|
";
|
|
|
|
[$source, $result] = createTest($source, $target);
|
|
$this->assertEquals($source, $result);
|
|
}
|
|
} |