Skip to content

Commit 3b68ddd

Browse files
authored
Merge pull request #600 from phpDocumentor/task/markdown
[TASK] Make Markdown availible in integration tests
2 parents 52d9f5d + 97ed105 commit 3b68ddd

File tree

8 files changed

+77
-2
lines changed

8 files changed

+77
-2
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"phpdocumentor/guides": "@dev",
3838
"phpdocumentor/guides-cli": "@dev",
3939
"phpdocumentor/guides-graphs": "@dev",
40+
"phpdocumentor/guides-markdown": "@dev",
4041
"phpdocumentor/guides-restructured-text": "@dev",
4142
"phpdocumentor/guides-theme-bootstrap": "@dev",
4243
"psr/event-dispatcher": "^1.0",

composer.lock

Lines changed: 37 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/guides-markdown/resources/config/guides-markdown.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
declare(strict_types=1);
44

5+
use phpDocumentor\Guides\Markdown\MarkupLanguageParser;
56
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
67

78
return static function (ContainerConfigurator $container): void {
89
$container->services()
910
->defaults()
1011
->autowire()
11-
->autoconfigure();
12+
->autoconfigure()
13+
14+
->set(MarkupLanguageParser::class)
15+
->tag('phpdoc.guides.parser.markupLanguageParser');
1216
};

tests/ApplicationTestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use phpDocumentor\Guides\Cli\DependencyInjection\ApplicationExtension;
88
use phpDocumentor\Guides\Cli\DependencyInjection\ContainerFactory;
99
use phpDocumentor\Guides\DependencyInjection\TestExtension;
10+
use phpDocumentor\Guides\Markdown\DependencyInjection\MarkdownExtension;
1011
use PHPUnit\Framework\TestCase;
1112
use Symfony\Component\DependencyInjection\Container;
1213
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
@@ -37,6 +38,7 @@ protected function prepareContainer(string|null $configurationFile = null, array
3738
$containerFactory = new ContainerFactory([
3839
new ApplicationExtension(),
3940
new TestExtension(),
41+
new MarkdownExtension(),
4042
...$extraExtensions,
4143
]);
4244

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Project Title</title>
5+
6+
</head>
7+
<body>
8+
<h1>Markdown Example</h1>
9+
<p>This is a Markdown document with some basic formatting.</p>
10+
11+
<h2>Headings</h2>
12+
13+
<p>You can create headings using hash symbols.</p>
14+
15+
</body>
16+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<guides
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://www.phpdoc.org/guides packages/guides-cli/resources/schema/guides.xsd"
5+
input-format="md"
6+
>
7+
<project title="Project Title" version="6.4"/>
8+
</guides>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Markdown Example
2+
3+
This is a Markdown document with some basic formatting.
4+
5+
## Headings
6+
7+
You can create headings using hash symbols.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Paragraph text is missing in output, there is a warning about the document having no title even though it has a title

0 commit comments

Comments
 (0)