diff --git a/tests/fixtures/expected/toctree/index.html b/tests/fixtures/expected/toctree/index.html
index e07a28e7..676005ad 100644
--- a/tests/fixtures/expected/toctree/index.html
+++ b/tests/fixtures/expected/toctree/index.html
@@ -9,11 +9,11 @@
diff --git a/tests/fixtures/source/blocks/code-blocks/php-attributes.rst b/tests/fixtures/source/blocks/code-blocks/php-attributes.rst
new file mode 100644
index 00000000..808e6c45
--- /dev/null
+++ b/tests/fixtures/source/blocks/code-blocks/php-attributes.rst
@@ -0,0 +1,67 @@
+.. code-block:: php-attributes
+
+ // src/SomePath/SomeClass.php
+ namespace App\SomePath;
+
+ use Symfony\Component\Validator\Constraints as Assert;
+
+ class SomeClass
+ {
+ #[AttributeName]
+ private $property1;
+
+ #[AttributeName()]
+ private $property2;
+
+ #[AttributeName('value')]
+ private $property3;
+
+ #[AttributeName('value', option: 'value')]
+ private $property4;
+
+ #[AttributeName(['value' => 'value'])]
+ private $property5;
+
+ #[AttributeName(
+ 'value',
+ option: 'value'
+ )]
+ private $property6;
+
+ #[Assert\AttributeName('value')]
+ private $property7;
+
+ #[Assert\AttributeName(
+ 'value',
+ option: 'value'
+ )]
+ private $property8;
+
+ #[Route('/blog/{page<\d+>}', name: 'blog_list')]
+ private $property9;
+
+ #[Assert\GreaterThanOrEqual(
+ value: 18,
+ )]
+ private $property10;
+
+ #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
+ private $property11;
+
+ #[Assert\AtLeastOneOf([
+ new Assert\Regex('/#/'),
+ new Assert\Length(min: 10),
+ ])]
+ private $property12;
+
+ public function __construct(
+ #[TaggedIterator('app.handlers')]
+ iterable $handlers,
+ ) {
+ }
+
+ #[AsController]
+ public function someAction(#[CurrentUser] User $user)
+ {
+ }
+ }
diff --git a/tests/fixtures/source/blocks/code-blocks/php-nested-comments.rst b/tests/fixtures/source/blocks/code-blocks/php-nested-comments.rst
new file mode 100644
index 00000000..ea8dc0f4
--- /dev/null
+++ b/tests/fixtures/source/blocks/code-blocks/php-nested-comments.rst
@@ -0,0 +1,12 @@
+You can do that by adding a "stamp" to your message::
+
+ use Symfony\Component\Messenger\MessageBusInterface;
+ use Symfony\Component\Messenger\Stamp\DelayStamp;
+
+ public function index(MessageBusInterface $bus)
+ {
+ $bus->dispatch(new SmsNotification('...'), [
+ // wait 5 seconds before processing
+ new DelayStamp(5000),
+ ]);
+ }
diff --git a/tests/fixtures/source/blocks/code-blocks/php.rst b/tests/fixtures/source/blocks/code-blocks/php.rst
index e9d65938..33ed08e6 100644
--- a/tests/fixtures/source/blocks/code-blocks/php.rst
+++ b/tests/fixtures/source/blocks/code-blocks/php.rst
@@ -1,9 +1,56 @@
-
.. code-block:: php
+
// config/routes.php
namespace Symfony\Component\Routing\Loader\Configurator;
- return function (RoutingConfigurator $routes) {
+ use App\Controller\CompanyController;
+
+ return static function (RoutingConfigurator $routes): void {
$routes->add('about_us', ['nl' => '/over-ons', 'en' => '/about-us'])
- ->controller('App\Controller\CompanyController::about');
+ ->controller(CompanyController::class.'::about');
};
+
+.. code-block:: php
+
+ enum TextAlign: string implements TranslatableInterface
+ {
+ case Left = 'Left aligned';
+ case Center = 'Center aligned';
+ case Right = 'Right aligned';
+
+ public function trans(TranslatorInterface $translator, ?string $locale = null): string
+ {
+ // Translate enum using custom labels
+ return match ($this) {
+ self::Left => $translator->trans('text_align.left.label', locale: $locale),
+ self::Center => $translator->trans('text_align.center.label', locale: $locale),
+ self::Right => $translator->trans('text_align.right.label', locale: $locale),
+ };
+ }
+ }
+
+.. code-block:: php
+
+ public function getUserBadgeFrom(string $accessToken): UserBadge
+ {
+ // get the data from the token
+ $payload = ...;
+
+ return new UserBadge(
+ $payload->getUserId(),
+ fn (string $userIdentifier): User => new User($userIdentifier, $payload->getRoles())
+ );
+
+ // or
+ return new UserBadge(
+ $payload->getUserId(),
+ $this->loadUser(...)
+ );
+ }
+
+.. code-block:: php
+
+ public function __construct(
+ private string $username
+ ) {
+ }
diff --git a/tests/fixtures/source/blocks/code-blocks/twig.rst b/tests/fixtures/source/blocks/code-blocks/twig.rst
index 01d06851..229041d1 100644
--- a/tests/fixtures/source/blocks/code-blocks/twig.rst
+++ b/tests/fixtures/source/blocks/code-blocks/twig.rst
@@ -1,3 +1,11 @@
-
.. code-block:: twig
+
{# some code #}
+ {%
+ set some_var = 'some value' # some inline comment
+ %}
+ {{
+ # another inline comment
+ 'Lorem Ipsum'|uppercase
+ # final inline comment
+ }}
diff --git a/tests/fixtures/source/blocks/code-blocks/yaml.rst b/tests/fixtures/source/blocks/code-blocks/yaml.rst
index 45ce98d5..f56652d3 100644
--- a/tests/fixtures/source/blocks/code-blocks/yaml.rst
+++ b/tests/fixtures/source/blocks/code-blocks/yaml.rst
@@ -1,3 +1,12 @@
.. code-block:: yaml
# some code
+ parameters:
+ credit_card_number: 1234_5678_9012_3456
+ long_number: 10_000_000_000
+ pi: 3.14159_26535_89793
+ hex_words: 0x_CAFE_F00D
+ canonical: 2001-12-15T02:59:43.1Z
+ iso8601: 2001-12-14t21:59:43.10-05:00
+ spaced: 2001-12-14 21:59:43.10 -5
+ date: 2002-12-14
diff --git a/tests/fixtures/source/blocks/directives/danger.rst b/tests/fixtures/source/blocks/directives/danger.rst
new file mode 100644
index 00000000..dfc42179
--- /dev/null
+++ b/tests/fixtures/source/blocks/directives/danger.rst
@@ -0,0 +1,4 @@
+
+.. danger::
+
+ This message is about security risk or data integrity threat.
diff --git a/tests/fixtures/source/blocks/directives/tabs.rst b/tests/fixtures/source/blocks/directives/tabs.rst
new file mode 100644
index 00000000..555a7328
--- /dev/null
+++ b/tests/fixtures/source/blocks/directives/tabs.rst
@@ -0,0 +1,16 @@
+
+.. tabs:: UX Installation
+
+ .. tab:: Webpack Encore
+
+ Webpack Encore stuff!
+
+ .. code-block:: yaml
+
+ I am yaml:
+
+ .. tab:: AssetMapper
+
+ AssetMapper stuff!
+
+ And another paragraph.
diff --git a/tests/fixtures/source/blocks/nodes/text.rst b/tests/fixtures/source/blocks/nodes/text.rst
new file mode 100644
index 00000000..f5dbb33e
--- /dev/null
+++ b/tests/fixtures/source/blocks/nodes/text.rst
@@ -0,0 +1,7 @@
+**Lorem ipsum** dolor sit amet, consectetur adipisicing elit. Ut enim ad minim
+veniam, quis nostrud *exercitation ullamco laboris* nisi ut aliquip ex ea
+commodo consequat. ``Duis aute irure dolor`` in reprehenderit in voluptate
+velit esse cillum dolore eu fugiat nulla pariatur.
+
+Excepteur ~1,000 sint! Occaecat cupidatat non proident, sunt in culpa qui officia
+deserunt mollit anim id est laborum. áàâäãåéèêëíìîïóòôöõúùûüñçÿ
diff --git a/tests/fixtures/source/blocks/nodes/title.rst b/tests/fixtures/source/blocks/nodes/title.rst
index 7014b146..60269213 100644
--- a/tests/fixtures/source/blocks/nodes/title.rst
+++ b/tests/fixtures/source/blocks/nodes/title.rst
@@ -12,3 +12,6 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit.
-----------------------------
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
+
+``Checking your Work Environment``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\ No newline at end of file
diff --git a/tests/fixtures/source/blocks/references/php-class.rst b/tests/fixtures/source/blocks/references/php-class.rst
index 5708c647..284a9018 100644
--- a/tests/fixtures/source/blocks/references/php-class.rst
+++ b/tests/fixtures/source/blocks/references/php-class.rst
@@ -1,2 +1,4 @@
:phpclass:`ArrayAccess`
+
+:phpclass:`BcMath\\Number`
diff --git a/tests/fixtures/source/blocks/references/php-method.rst b/tests/fixtures/source/blocks/references/php-method.rst
index 11705cd5..26d782d5 100644
--- a/tests/fixtures/source/blocks/references/php-method.rst
+++ b/tests/fixtures/source/blocks/references/php-method.rst
@@ -1,2 +1,4 @@
:phpmethod:`Locale::getDefault`
+
+:phpmethod:`BcMath\\Number::add`
diff --git a/tests/fixtures/source/json/design.rst b/tests/fixtures/source/json/design.rst
index b9a4537e..2711ac4a 100644
--- a/tests/fixtures/source/json/design.rst
+++ b/tests/fixtures/source/json/design.rst
@@ -11,11 +11,17 @@ The toctree below should affects the next/prev. The
first entry is effectively ignored, as it was already
included by the toctree in index.rst (which is parsed first).
-Subsection 1
-~~~~~~~~~~~~
+Some subsection
+~~~~~~~~~~~~~~~
This is a subsection of the first section. That's all.
+Some subsection
+~~~~~~~~~~~~~~~
+
+This sub-section uses the same title as before to test that the tool
+never generated two or more headings with the same ID.
+
Section 2
---------
@@ -23,6 +29,12 @@ However, crud (which is ALSO included in the toctree in index.rst),
WILL be read here, as the "crud" in index.rst has not been read
yet (design comes first). Also, design/sub-page WILL be considered.
+Some subsection
+~~~~~~~~~~~~~~~
+
+This sub-section also uses the same title as in the previous section
+to test that the tool never generated two or more headings with the same ID.
+
.. toctree::
:maxdepth: 1