Skip to content

Commit 08ba794

Browse files
committed
Mark failing block tests as skipped
1 parent 80c3ce5 commit 08ba794

File tree

12 files changed

+23
-5
lines changed

12 files changed

+23
-5
lines changed

.github/workflows/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
./vendor/bin/simple-phpunit install
3333
3434
- name: PHPUnit
35-
run: cd lib/docs-builder && vendor/bin/simple-phpunit
35+
run: cd lib/docs-builder && vendor/bin/simple-phpunit --testdox

lib/docs-builder/src/DocBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function build(BuildEnvironment $buildEnvironment): void
3131
/** @var list<DocumentNode> $documents */
3232
$documents = $this->commandBus->handle(new ParseDirectoryCommand($buildEnvironment->getSourceFilesystem(), '/', 'rst'));
3333

34-
$this->commandBus->handle(new CompileDocumentsCommand($documents));
34+
$documents = $this->commandBus->handle(new CompileDocumentsCommand($documents));
3535

3636
foreach ($documents as $document) {
3737
$this->commandBus->handle(new RenderDocumentCommand(

lib/docs-builder/tests/integration/HtmlIntegrationTest.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ class HtmlIntegrationTest extends TestCase
1616
/** @dataProvider provideBlocks */
1717
public function testBlocks(string $sourceFile, string $expectedFile)
1818
{
19+
$expectedContents = file_get_contents($expectedFile);
20+
if (str_starts_with($expectedContents, 'SKIP')) {
21+
if ($_SERVER['TEST_ALL'] ?? false) {
22+
$expectedContents = strstr($expectedContents, "\n");
23+
} else {
24+
$this->markTestIncomplete(trim(substr(strstr($expectedContents, "\n", true), 4)));
25+
}
26+
}
27+
1928
$generatedContents = DocsKernel::create()->get(DocBuilder::class)->buildString(file_get_contents($sourceFile));
2029
$generated = new \DOMDocument();
2130
$generated->loadHTML($generatedContents, \LIBXML_NOERROR);
2231
$generated->preserveWhiteSpace = false;
2332
$generatedHtml = $this->sanitizeHTML($generated->saveHTML());
2433

2534
$expected = new \DOMDocument();
26-
$expectedContents = "<!DOCTYPE html>\n<html>\n<body>\n".file_get_contents($expectedFile)."\n</body>\n</html>";
35+
$expectedContents = "<!DOCTYPE html>\n<html>\n<body>\n".$expectedContents."\n</body>\n</html>";
2736
$expected->loadHTML($expectedContents, \LIBXML_NOERROR);
2837
$expected->preserveWhiteSpace = false;
2938
$expectedHtml = $this->sanitizeHTML($expected->saveHTML());

lib/docs-builder/tests/integration/fixtures/expected/blocks/code-blocks/code-caption.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SKIP https://github.com/phpDocumentor/guides/issues/303
12
<div translate="no" data-loc="1" class="notranslate codeblock codeblock-length-sm codeblock-php codeblock-has-caption">
23
<div class="codeblock-caption">config/routes.php</div>
34
<div class="codeblock-scroll">

lib/docs-builder/tests/integration/fixtures/expected/blocks/code-blocks/terminal.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SKIP https://github.com/phpDocumentor/guides/issues/302
12
<div translate="no" data-loc="1" class="notranslate codeblock codeblock-length-sm codeblock-terminal codeblock-bash">
23
<div class="codeblock-scroll">
34
<pre class="codeblock-lines">1</pre>

lib/docs-builder/tests/integration/fixtures/expected/blocks/directives/configuration-block.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SKIP https://github.com/wouterj/symfony-docs-guides/issues/4
12
<div class="configuration-block">
23
<div role="tablist" aria-label="Configuration formats" class="configuration-tabs configuration-tabs-length-2">
34
<button role="tab" type="button" data-language="yaml" aria-controls="configuration-block-tabpanel-5c4d43ebaab8414c439c1c2a1cd2ec14602f7bdc" aria-selected="true" data-active="true"> <span>YAML</span> </button>

lib/docs-builder/tests/integration/fixtures/expected/blocks/directives/deprecated.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="admonition admonition-deprecated ">
1+
SKIP https://github.com/phpDocumentor/guides/issues/305
2+
<div class="admonition admonition-deprecated">
23
<p class="admonition-title">
34
<span>5.4</span>
45
</p>

lib/docs-builder/tests/integration/fixtures/expected/blocks/directives/sidebar.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SKIP https://github.com/phpDocumentor/guides/issues/305
12
<div class="admonition admonition-sidebar">
23
<p class="sidebar-title">The sidebar's title</p>
34
<p>some text inside sidebar</p>

lib/docs-builder/tests/integration/fixtures/expected/blocks/directives/versionadded.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="admonition admonition-versionadded ">
1+
SKIP https://github.com/phpDocumentor/guides/issues/305
2+
<div class="admonition admonition-versionadded">
23
<p class="admonition-title">
34
<span>4.1</span>
45
</p>

lib/docs-builder/tests/integration/fixtures/expected/blocks/nodes/figure.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SKIP https://github.com/wouterj/symfony-docs-guides/issues/3
12
<figure>
23
<img src="images/logo.png" width="200px" alt="Symfony Logo">
34
</figure>

lib/docs-builder/tests/integration/fixtures/expected/blocks/nodes/literal.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SKIP https://github.com/phpDocumentor/guides/issues/305
12
<p>here is some php code from literal:</p>
23
<div translate="no" data-loc="7" class="notranslate codeblock codeblock-length-sm codeblock-php">
34
<div class="codeblock-scroll">
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SKIP https://github.com/phpDocumentor/guides/issues/305
12
<p>Next, create the template used to render the field in the <code translate="no" class="notranslate">index</code> and <code translate="no" class="notranslate">detail</code>
23
<a href="https://symfony.com/doc/current/bundles/EasyAdminBundle/crud.html" class="reference external">CRUD pages</a>.</p>
34
<p>More about CRUD pages.</p>

0 commit comments

Comments
 (0)