From 46e1c07998872511a98fcd00d1f22fd486bdecaa Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 18 Mar 2021 21:20:10 -0400 Subject: [PATCH 1/4] Failing test case for a missing line break with anchors --- tests/IntegrationTest.php | 12 +++++++++++- .../blocks/references/reference-and-code.html | 15 +++++++++++++++ .../blocks/references/reference-and-code.rst | 6 ++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/expected/blocks/references/reference-and-code.html create mode 100644 tests/fixtures/source/blocks/references/reference-and-code.rst diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 79cdf69..1230d08 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -85,7 +85,7 @@ public function integrationProvider() /** * @dataProvider parserUnitBlockProvider */ - public function testParseUnitBlock(string $blockName) + public function testParseUnitBlock(string $blockName, bool $useIndenter = true) { $configuration = new Configuration(); $configuration->setCustomTemplateDirs([__DIR__.'/Templates']); @@ -101,6 +101,11 @@ public function testParseUnitBlock(string $blockName) $indenter = $this->createIndenter(); $expectedFile = sprintf('%s/fixtures/expected/blocks/%s.html', __DIR__, $blockName); + + if (!$useIndenter) { + $this->assertSame(file_get_contents($expectedFile), $document); + } + $this->assertSame( str_replace(" \n", "\n", $indenter->indent(file_get_contents($expectedFile))), str_replace(" \n", "\n", $indenter->indent($document)) @@ -197,6 +202,11 @@ public function parserUnitBlockProvider() 'blockName' => 'references/php-method', ]; + yield 'reference-and-code' => [ + 'blockName' => 'references/reference-and-code', + 'useIndenter' => false, + ]; + yield 'code-block-php' => [ 'blockName' => 'code-blocks/php', ]; diff --git a/tests/fixtures/expected/blocks/references/reference-and-code.html b/tests/fixtures/expected/blocks/references/reference-and-code.html new file mode 100644 index 0000000..67ecca7 --- /dev/null +++ b/tests/fixtures/expected/blocks/references/reference-and-code.html @@ -0,0 +1,15 @@ + + + + + + + + + +

Next, create the template used to render the field in the index and detail +CRUD pages.

+

More about CRUD pages.

+ + + diff --git a/tests/fixtures/source/blocks/references/reference-and-code.rst b/tests/fixtures/source/blocks/references/reference-and-code.rst new file mode 100644 index 0000000..b54e1f2 --- /dev/null +++ b/tests/fixtures/source/blocks/references/reference-and-code.rst @@ -0,0 +1,6 @@ +Next, create the template used to render the field in the ``index`` and ``detail`` +`CRUD pages`_. + +More about CRUD pages. + +.. _`CRUD pages`: https://symfony.com/doc/current/bundles/EasyAdminBundle/crud.html From 42e515ee9c6bdb6359773dd27d26d6c097e68c43 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 18 Mar 2021 21:43:19 -0400 Subject: [PATCH 2/4] Fixing bug by removing spaceless... --- src/Templates/default/html/paragraph.html.twig | 5 +++++ tests/fixtures/expected/main/datetime.html | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 src/Templates/default/html/paragraph.html.twig diff --git a/src/Templates/default/html/paragraph.html.twig b/src/Templates/default/html/paragraph.html.twig new file mode 100644 index 0000000..10baa0b --- /dev/null +++ b/src/Templates/default/html/paragraph.html.twig @@ -0,0 +1,5 @@ +{% set text = paragraphNode.value.render()|trim %} + +{% if text %} + {{ text|raw }}

+{% endif %} diff --git a/tests/fixtures/expected/main/datetime.html b/tests/fixtures/expected/main/datetime.html index add9467..c4b798e 100644 --- a/tests/fixtures/expected/main/datetime.html +++ b/tests/fixtures/expected/main/datetime.html @@ -57,7 +57,7 @@

Field Options

The date_format Option

-

type: integer or stringdefault: IntlDateFormatter::MEDIUM

+

type: integer or string default: IntlDateFormatter::MEDIUM

Defines the format option that will be passed down to the date field. for more details.

@@ -134,7 +134,7 @@

format

-

type: stringdefault: Symfony\Component\Form\Extension\Core\Type\DateTimeType::HTML5_FORMAT

+

type: string default: Symfony\Component\Form\Extension\Core\Type\DateTimeType::HTML5_FORMAT

If the widget option is set to single_text, this option specifies the format of the input, i.e. how Symfony will interpret the given input as a datetime string. See Date/Time Format Syntax.

@@ -154,12 +154,12 @@

time_widget

-

type: stringdefault: choice

+

type: string default: choice

Defines the widget option for the TimeType.

widget

-

type: stringdefault: null

+

type: string default: null

Defines the widget option for both the DateType. and TimeType. This can be overridden with the date_widget and time_widget options.

From bc26394dc8c4dd9ed5ba6c6b52b5e8a645b654ec Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 18 Mar 2021 22:00:45 -0400 Subject: [PATCH 3/4] Removing non-bod text from "block" tests and asserting exact HTML with spacing --- .../default/html/paragraph.html.twig | 4 +-- tests/IntegrationTest.php | 19 +++++------- .../expected/blocks/code-blocks/bash.html | 14 +-------- .../expected/blocks/code-blocks/html-php.html | 15 +--------- .../blocks/code-blocks/html-twig.html | 14 +-------- .../expected/blocks/code-blocks/html.html | 15 +--------- .../expected/blocks/code-blocks/ini.html | 14 +-------- .../blocks/code-blocks/php-annotations.html | 14 +-------- .../expected/blocks/code-blocks/php.html | 14 +-------- .../expected/blocks/code-blocks/terminal.html | 20 ------------- .../expected/blocks/code-blocks/text.html | 14 +-------- .../expected/blocks/code-blocks/twig.html | 14 +-------- .../expected/blocks/code-blocks/xml.html | 14 +-------- .../expected/blocks/code-blocks/yaml.html | 14 +-------- .../blocks/directives/admonition.html | 14 +-------- .../blocks/directives/best-practice.html | 14 +-------- .../expected/blocks/directives/caution.html | 14 +-------- .../expected/blocks/directives/class.html | 14 +-------- .../directives/configuration-block.html | 14 +-------- .../directives/note-code-block-nested.html | 14 +-------- .../expected/blocks/directives/note.html | 14 +-------- .../expected/blocks/directives/seealso.html | 29 ++++++------------- .../directives/sidebar-code-block-nested.html | 14 +-------- .../expected/blocks/directives/sidebar.html | 14 +-------- .../expected/blocks/directives/tip.html | 14 +-------- .../expected/blocks/directives/topic.html | 14 +-------- .../blocks/directives/versionadded.html | 21 -------------- .../fixtures/expected/blocks/nodes/list.html | 15 +--------- .../expected/blocks/nodes/literal.html | 25 +++------------- .../expected/blocks/nodes/tables.html | 26 ++++------------- .../expected/blocks/references/class.html | 14 +-------- .../expected/blocks/references/method.html | 14 +-------- .../expected/blocks/references/namespace.html | 14 +-------- .../expected/blocks/references/php-class.html | 14 +-------- .../blocks/references/php-function.html | 14 +-------- .../blocks/references/php-method.html | 14 +-------- .../blocks/references/reference-and-code.html | 14 +-------- 37 files changed, 57 insertions(+), 510 deletions(-) delete mode 100644 tests/fixtures/expected/blocks/directives/versionadded.html diff --git a/src/Templates/default/html/paragraph.html.twig b/src/Templates/default/html/paragraph.html.twig index 10baa0b..9c680df 100644 --- a/src/Templates/default/html/paragraph.html.twig +++ b/src/Templates/default/html/paragraph.html.twig @@ -1,5 +1,5 @@ {% set text = paragraphNode.value.render()|trim %} -{% if text %} - {{ text|raw }}

+{%- if text %} +{{ text|raw }}

{% endif %} diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 1230d08..9313a4e 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -85,7 +85,7 @@ public function integrationProvider() /** * @dataProvider parserUnitBlockProvider */ - public function testParseUnitBlock(string $blockName, bool $useIndenter = true) + public function testParseUnitBlock(string $blockName) { $configuration = new Configuration(); $configuration->setCustomTemplateDirs([__DIR__.'/Templates']); @@ -96,19 +96,15 @@ public function testParseUnitBlock(string $blockName, bool $useIndenter = true) $sourceFile = sprintf('%s/fixtures/source/blocks/%s.rst', __DIR__, $blockName); - $document = $parser->parseFile($sourceFile)->renderDocument(); + $actualHtml = $parser->parseFile($sourceFile)->renderDocument(); + $expectedHtml = file_get_contents(sprintf('%s/fixtures/expected/blocks/%s.html', __DIR__, $blockName)); - $indenter = $this->createIndenter(); - - $expectedFile = sprintf('%s/fixtures/expected/blocks/%s.html', __DIR__, $blockName); - - if (!$useIndenter) { - $this->assertSame(file_get_contents($expectedFile), $document); - } + $actualCrawler = new Crawler($actualHtml); + $expectedCrawler = new Crawler($expectedHtml); $this->assertSame( - str_replace(" \n", "\n", $indenter->indent(file_get_contents($expectedFile))), - str_replace(" \n", "\n", $indenter->indent($document)) + trim($expectedCrawler->filter('body')->html()), + trim($actualCrawler->filter('body')->html()) ); } @@ -204,7 +200,6 @@ public function parserUnitBlockProvider() yield 'reference-and-code' => [ 'blockName' => 'references/reference-and-code', - 'useIndenter' => false, ]; yield 'code-block-php' => [ diff --git a/tests/fixtures/expected/blocks/code-blocks/bash.html b/tests/fixtures/expected/blocks/code-blocks/bash.html index 1161c18..9477b1b 100644 --- a/tests/fixtures/expected/blocks/code-blocks/bash.html +++ b/tests/fixtures/expected/blocks/code-blocks/bash.html @@ -1,19 +1,7 @@ - - - - - - - - - -
+
1
git clone git@github.com:symfony/symfony.git
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/html-php.html b/tests/fixtures/expected/blocks/code-blocks/html-php.html index 786d4c9..8f666aa 100644 --- a/tests/fixtures/expected/blocks/code-blocks/html-php.html +++ b/tests/fixtures/expected/blocks/code-blocks/html-php.html @@ -1,13 +1,4 @@ - - - - - - - - - -
+
1
 2
@@ -35,7 +26,3 @@
 </html>
 
-
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/html-twig.html b/tests/fixtures/expected/blocks/code-blocks/html-twig.html index 0aafd23..460bb83 100644 --- a/tests/fixtures/expected/blocks/code-blocks/html-twig.html +++ b/tests/fixtures/expected/blocks/code-blocks/html-twig.html @@ -1,13 +1,4 @@ - - - - - - - - - -
+
1
 2
@@ -16,6 +7,3 @@
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/html.html b/tests/fixtures/expected/blocks/code-blocks/html.html index 4261a2e..cd3f419 100644 --- a/tests/fixtures/expected/blocks/code-blocks/html.html +++ b/tests/fixtures/expected/blocks/code-blocks/html.html @@ -1,19 +1,6 @@ - - - - - - - - - -
+
1
<!-- some code -->
 
-
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/ini.html b/tests/fixtures/expected/blocks/code-blocks/ini.html index 0f52ec4..98f2b89 100644 --- a/tests/fixtures/expected/blocks/code-blocks/ini.html +++ b/tests/fixtures/expected/blocks/code-blocks/ini.html @@ -1,19 +1,7 @@ - - - - - - - - - -
+
1
fetch = +refs/notes/*:refs/notes/*
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/php-annotations.html b/tests/fixtures/expected/blocks/code-blocks/php-annotations.html index 8a5d85c..b18b0f2 100644 --- a/tests/fixtures/expected/blocks/code-blocks/php-annotations.html +++ b/tests/fixtures/expected/blocks/code-blocks/php-annotations.html @@ -1,13 +1,4 @@ - - - - - - - - - -
+
1
 2
@@ -40,6 +31,3 @@
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/php.html b/tests/fixtures/expected/blocks/code-blocks/php.html index 5880771..98dd193 100644 --- a/tests/fixtures/expected/blocks/code-blocks/php.html +++ b/tests/fixtures/expected/blocks/code-blocks/php.html @@ -1,13 +1,4 @@ - - - - - - - - - -
+
1
 2
@@ -26,6 +17,3 @@
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/terminal.html b/tests/fixtures/expected/blocks/code-blocks/terminal.html index bde9415..05e5424 100644 --- a/tests/fixtures/expected/blocks/code-blocks/terminal.html +++ b/tests/fixtures/expected/blocks/code-blocks/terminal.html @@ -1,20 +1,3 @@ - - - - - - - - - -
-
-
1
-
git clone git@github.com:symfony/symfony.git
-
-
-
-
1
@@ -43,6 +26,3 @@
        
- - - diff --git a/tests/fixtures/expected/blocks/code-blocks/text.html b/tests/fixtures/expected/blocks/code-blocks/text.html index 8980981..85d5867 100644 --- a/tests/fixtures/expected/blocks/code-blocks/text.html +++ b/tests/fixtures/expected/blocks/code-blocks/text.html @@ -1,19 +1,7 @@ - - - - - - - - - -
+
1
some text
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/twig.html b/tests/fixtures/expected/blocks/code-blocks/twig.html index 2e42e64..88b5c1c 100644 --- a/tests/fixtures/expected/blocks/code-blocks/twig.html +++ b/tests/fixtures/expected/blocks/code-blocks/twig.html @@ -1,19 +1,7 @@ - - - - - - - - - -
+
1
{# some code #}
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/xml.html b/tests/fixtures/expected/blocks/code-blocks/xml.html index c1c05de..d0afb89 100644 --- a/tests/fixtures/expected/blocks/code-blocks/xml.html +++ b/tests/fixtures/expected/blocks/code-blocks/xml.html @@ -1,19 +1,7 @@ - - - - - - - - - -
+
1
<!-- some code -->
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/code-blocks/yaml.html b/tests/fixtures/expected/blocks/code-blocks/yaml.html index 13e8608..1b8a97b 100644 --- a/tests/fixtures/expected/blocks/code-blocks/yaml.html +++ b/tests/fixtures/expected/blocks/code-blocks/yaml.html @@ -1,19 +1,7 @@ - - - - - - - - - -
+
1
# some code
 
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/admonition.html b/tests/fixtures/expected/blocks/directives/admonition.html index 5c67841..9d7e971 100644 --- a/tests/fixtures/expected/blocks/directives/admonition.html +++ b/tests/fixtures/expected/blocks/directives/admonition.html @@ -1,17 +1,5 @@ - - - - - - - - - -
+

Screencast

Do you prefer video tutorials? Check out the the screencasts.

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/best-practice.html b/tests/fixtures/expected/blocks/directives/best-practice.html index 1ed1305..91a4e80 100644 --- a/tests/fixtures/expected/blocks/directives/best-practice.html +++ b/tests/fixtures/expected/blocks/directives/best-practice.html @@ -1,17 +1,5 @@ - - - - - - - - - -
+

Best Practice

Use the bcrypt encoder for hashing your users' passwords.

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/caution.html b/tests/fixtures/expected/blocks/directives/caution.html index 457b6b8..2c51d5b 100644 --- a/tests/fixtures/expected/blocks/directives/caution.html +++ b/tests/fixtures/expected/blocks/directives/caution.html @@ -1,18 +1,6 @@ - - - - - - - - - -
+

Caution

Using too many sidebars or caution directives can be distracting!

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/class.html b/tests/fixtures/expected/blocks/directives/class.html index 596dfda..22c1635 100644 --- a/tests/fixtures/expected/blocks/directives/class.html +++ b/tests/fixtures/expected/blocks/directives/class.html @@ -1,18 +1,6 @@ - - - - - - - - - -
  • list-item-1
  • +
    • list-item-1
    • list-item-2
    • list-item-3

    some text

    - - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/configuration-block.html b/tests/fixtures/expected/blocks/directives/configuration-block.html index 7d6505d..25b41bc 100644 --- a/tests/fixtures/expected/blocks/directives/configuration-block.html +++ b/tests/fixtures/expected/blocks/directives/configuration-block.html @@ -1,13 +1,4 @@ - - - - - - - - - -
    +
    • YAML @@ -30,6 +21,3 @@
- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/note-code-block-nested.html b/tests/fixtures/expected/blocks/directives/note-code-block-nested.html index d3ff26e..29e5ba0 100644 --- a/tests/fixtures/expected/blocks/directives/note-code-block-nested.html +++ b/tests/fixtures/expected/blocks/directives/note-code-block-nested.html @@ -1,13 +1,4 @@ - - - - - - - - - -
+

Note @@ -20,6 +11,3 @@

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/note.html b/tests/fixtures/expected/blocks/directives/note.html index e056eaa..ca8ecf7 100644 --- a/tests/fixtures/expected/blocks/directives/note.html +++ b/tests/fixtures/expected/blocks/directives/note.html @@ -1,18 +1,6 @@ - - - - - - - - - -
+

Note

Sometimes we add notes. But not too often because they interrupt the flow.

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/seealso.html b/tests/fixtures/expected/blocks/directives/seealso.html index ae9f807..ab33b20 100644 --- a/tests/fixtures/expected/blocks/directives/seealso.html +++ b/tests/fixtures/expected/blocks/directives/seealso.html @@ -1,20 +1,9 @@ - - - - - - - - - -
-

- - - - See also -

-

Also check out the homepage

-
- - +
+

+ + + + See also +

+

Also check out the homepage

+
diff --git a/tests/fixtures/expected/blocks/directives/sidebar-code-block-nested.html b/tests/fixtures/expected/blocks/directives/sidebar-code-block-nested.html index 8e67aaa..2d2f0f1 100644 --- a/tests/fixtures/expected/blocks/directives/sidebar-code-block-nested.html +++ b/tests/fixtures/expected/blocks/directives/sidebar-code-block-nested.html @@ -1,13 +1,4 @@ - - - - - - - - - -

some text before code block

+

some text before code block

1
@@ -17,6 +8,3 @@

some text after code block

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/sidebar.html b/tests/fixtures/expected/blocks/directives/sidebar.html index 2952441..62daa97 100644 --- a/tests/fixtures/expected/blocks/directives/sidebar.html +++ b/tests/fixtures/expected/blocks/directives/sidebar.html @@ -1,14 +1,2 @@ - - - - - - - - - -

some text inside sidebar

+

some text inside sidebar

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/tip.html b/tests/fixtures/expected/blocks/directives/tip.html index a26576b..6ef232b 100644 --- a/tests/fixtures/expected/blocks/directives/tip.html +++ b/tests/fixtures/expected/blocks/directives/tip.html @@ -1,18 +1,6 @@ - - - - - - - - - -
+

Tip

This is a little tip about something! We an also talk about specific

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/topic.html b/tests/fixtures/expected/blocks/directives/topic.html index 16c4447..48e35bc 100644 --- a/tests/fixtures/expected/blocks/directives/topic.html +++ b/tests/fixtures/expected/blocks/directives/topic.html @@ -1,15 +1,3 @@ - - - - - - - - - -
+

Example

Here is a sample comment for a bug report that could be reproduced.

- - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/directives/versionadded.html b/tests/fixtures/expected/blocks/directives/versionadded.html deleted file mode 100644 index 663039e..0000000 --- a/tests/fixtures/expected/blocks/directives/versionadded.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - -
-

- - - - New in version 4.1 -

-

This option was introduced in Symfony 2.6 and replaces another option, which is available prior to 2.6.

-
- - - diff --git a/tests/fixtures/expected/blocks/nodes/list.html b/tests/fixtures/expected/blocks/nodes/list.html index cc1fad6..74e46f6 100644 --- a/tests/fixtures/expected/blocks/nodes/list.html +++ b/tests/fixtures/expected/blocks/nodes/list.html @@ -1,18 +1,5 @@ - - - - - - - - - -
  • List item 1
  • +
    • List item 1
    • List item 2
    • List item 3
    • List item 4
    - - - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/nodes/literal.html b/tests/fixtures/expected/blocks/nodes/literal.html index f0eaec8..d5d2661 100644 --- a/tests/fixtures/expected/blocks/nodes/literal.html +++ b/tests/fixtures/expected/blocks/nodes/literal.html @@ -1,13 +1,4 @@ - - - - - - - - - -

    here is some php code from literal:

    +

    here is some php code from literal:

    1
    @@ -27,14 +18,6 @@
     
    - -

    - The CRUD controller of App\Entity\Example must implement -the - EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\CrudControllerInterface - , -but you can also extend from the AbstractCrudController class. -

    - - - +

    The CRUD controller of App\Entity\Example must implement +the EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\CrudControllerInterface, +but you can also extend from the AbstractCrudController class.

    diff --git a/tests/fixtures/expected/blocks/nodes/tables.html b/tests/fixtures/expected/blocks/nodes/tables.html index ad008ea..05142f4 100644 --- a/tests/fixtures/expected/blocks/nodes/tables.html +++ b/tests/fixtures/expected/blocks/nodes/tables.html @@ -1,13 +1,4 @@ - - - - - - - - - - +
    @@ -15,8 +6,7 @@ - - + @@ -30,8 +20,7 @@
    Route pathIf the requested URL is /foo/
    /foo It matches (200 status response)
    - - + @@ -54,8 +43,7 @@ - - + @@ -74,8 +62,7 @@ - - + @@ -95,6 +82,3 @@
    Cell 1 Cell 2Cell 2
    Cell 3 Cell 4Cell 2
    Cell 3 Cell 4
    - - - \ No newline at end of file diff --git a/tests/fixtures/expected/blocks/references/class.html b/tests/fixtures/expected/blocks/references/class.html index 74f2148..35afeec 100644 --- a/tests/fixtures/expected/blocks/references/class.html +++ b/tests/fixtures/expected/blocks/references/class.html @@ -1,13 +1 @@ - - - - - - - - - -

    ContainerAwareHttpKernel

    - - - \ No newline at end of file +

    ContainerAwareHttpKernel

    diff --git a/tests/fixtures/expected/blocks/references/method.html b/tests/fixtures/expected/blocks/references/method.html index 09ddab7..3b4d701 100644 --- a/tests/fixtures/expected/blocks/references/method.html +++ b/tests/fixtures/expected/blocks/references/method.html @@ -1,13 +1 @@ - - - - - - - - - -

    getCurrentRequest()

    - - - \ No newline at end of file +

    getCurrentRequest()

    diff --git a/tests/fixtures/expected/blocks/references/namespace.html b/tests/fixtures/expected/blocks/references/namespace.html index 69b820c..3dfb39f 100644 --- a/tests/fixtures/expected/blocks/references/namespace.html +++ b/tests/fixtures/expected/blocks/references/namespace.html @@ -1,13 +1 @@ - - - - - - - - - -

    HttpFoundation

    - - - \ No newline at end of file +

    HttpFoundation

    diff --git a/tests/fixtures/expected/blocks/references/php-class.html b/tests/fixtures/expected/blocks/references/php-class.html index dc8c36f..271b968 100644 --- a/tests/fixtures/expected/blocks/references/php-class.html +++ b/tests/fixtures/expected/blocks/references/php-class.html @@ -1,13 +1 @@ - - - - - - - - - -

    ArrayAccess

    - - - +

    ArrayAccess

    diff --git a/tests/fixtures/expected/blocks/references/php-function.html b/tests/fixtures/expected/blocks/references/php-function.html index 0a17f0a..0c9b85a 100644 --- a/tests/fixtures/expected/blocks/references/php-function.html +++ b/tests/fixtures/expected/blocks/references/php-function.html @@ -1,13 +1 @@ - - - - - - - - - -

    trigger_error

    - - - +

    trigger_error

    diff --git a/tests/fixtures/expected/blocks/references/php-method.html b/tests/fixtures/expected/blocks/references/php-method.html index 073efb9..e86c571 100644 --- a/tests/fixtures/expected/blocks/references/php-method.html +++ b/tests/fixtures/expected/blocks/references/php-method.html @@ -1,13 +1 @@ - - - - - - - - - -

    Locale::getDefault()

    - - - +

    Locale::getDefault()

    diff --git a/tests/fixtures/expected/blocks/references/reference-and-code.html b/tests/fixtures/expected/blocks/references/reference-and-code.html index 67ecca7..474be7e 100644 --- a/tests/fixtures/expected/blocks/references/reference-and-code.html +++ b/tests/fixtures/expected/blocks/references/reference-and-code.html @@ -1,15 +1,3 @@ - - - - - - - - - -

    Next, create the template used to render the field in the index and detail +

    Next, create the template used to render the field in the index and detail CRUD pages.

    More about CRUD pages.

    - - - From 107fe8bff4e34dee78f29fd00829e47ad9a4fad7 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 19 Mar 2021 13:56:10 -0400 Subject: [PATCH 4/4] re-adding indenter --- tests/AbstractIntegrationTest.php | 2 +- tests/IntegrationTest.php | 5 +++-- .../expected/blocks/code-blocks/terminal.html | 8 ++++++++ .../expected/blocks/directives/seealso.html | 16 ++++++++-------- .../expected/blocks/directives/versionadded.html | 9 +++++++++ 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 tests/fixtures/expected/blocks/directives/versionadded.html diff --git a/tests/AbstractIntegrationTest.php b/tests/AbstractIntegrationTest.php index d6719da..0c7819e 100644 --- a/tests/AbstractIntegrationTest.php +++ b/tests/AbstractIntegrationTest.php @@ -7,7 +7,7 @@ use Symfony\Component\Filesystem\Filesystem; use SymfonyDocsBuilder\BuildConfig; -class AbstractIntegrationTest extends TestCase +abstract class AbstractIntegrationTest extends TestCase { protected function createBuildConfig(string $sourceDir): BuildConfig { diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 9313a4e..28b3b71 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -101,10 +101,11 @@ public function testParseUnitBlock(string $blockName) $actualCrawler = new Crawler($actualHtml); $expectedCrawler = new Crawler($expectedHtml); + $indenter = $this->createIndenter(); $this->assertSame( - trim($expectedCrawler->filter('body')->html()), - trim($actualCrawler->filter('body')->html()) + $indenter->indent(trim($expectedCrawler->filter('body')->html())), + $indenter->indent(trim($actualCrawler->filter('body')->html())) ); } diff --git a/tests/fixtures/expected/blocks/code-blocks/terminal.html b/tests/fixtures/expected/blocks/code-blocks/terminal.html index 05e5424..b4134c9 100644 --- a/tests/fixtures/expected/blocks/code-blocks/terminal.html +++ b/tests/fixtures/expected/blocks/code-blocks/terminal.html @@ -1,3 +1,11 @@ +
    +
    +
    1
    +
    git clone git@github.com:symfony/symfony.git
    +
    +
    +
    1
    diff --git a/tests/fixtures/expected/blocks/directives/seealso.html b/tests/fixtures/expected/blocks/directives/seealso.html
    index ab33b20..52be87b 100644
    --- a/tests/fixtures/expected/blocks/directives/seealso.html
    +++ b/tests/fixtures/expected/blocks/directives/seealso.html
    @@ -1,9 +1,9 @@
     
    -

    - - - - See also -

    -

    Also check out the homepage

    -
    +

    + + + + See also +

    +

    Also check out the homepage

    +
    diff --git a/tests/fixtures/expected/blocks/directives/versionadded.html b/tests/fixtures/expected/blocks/directives/versionadded.html new file mode 100644 index 0000000..adfbbc8 --- /dev/null +++ b/tests/fixtures/expected/blocks/directives/versionadded.html @@ -0,0 +1,9 @@ +
    +

    + + + + New in version 4.1 + +

    +

    This option was introduced in Symfony 2.6 and replaces another option, which is available prior to 2.6.