Skip to content

fix(tests): Standardize tests for clarity and consistency across all test cases.#51

Merged
terabytesoftw merged 3 commits intomainfrom
fix_mini_12
Feb 21, 2026
Merged

fix(tests): Standardize tests for clarity and consistency across all test cases.#51
terabytesoftw merged 3 commits intomainfrom
fix_mini_12

Conversation

@terabytesoftw
Copy link
Contributor

Pull Request

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6210a52) to head (d3ab8fc).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #51   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       155       155           
===========================================
  Files             80        80           
  Lines            370       370           
===========================================
  Hits             370       370           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

Warning

Rate limit exceeded

@terabytesoftw has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 328539f and d3ab8fc.

📒 Files selected for processing (18)
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputDateTimeLocalTest.php
  • tests/Form/InputEmailTest.php
  • tests/Form/InputFileTest.php
  • tests/Form/InputImageTest.php
  • tests/Form/InputMonthTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputPasswordTest.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputRangeTest.php
  • tests/Form/InputResetTest.php
  • tests/Form/InputSearchTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Form/InputTelTest.php
  • tests/Form/InputTextTest.php
  • tests/Form/InputTimeTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputWeekTest.php
📝 Walkthrough

Walkthrough

This PR standardizes test expectations across the entire test suite for clarity and consistency. Changes include replacing data-test attributes with class, normalizing test values to generic placeholders, adding BackedString enum support, and introducing new test methods for attribute rendering scenarios.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added bug #50 entry documenting test standardization effort.
Embedded Components
tests/Embedded/ImgTest.php
Updated attribute defaults (data-test → class), normalized test values to "value", added testRenderWithClassUsingEnum, updated 59 lines.
Flow Components
tests/Flow/DivTest.php, tests/Flow/HrTest.php, tests/Flow/MainTest.php, tests/Flow/PTest.php
Standardized attribute handling across flow elements: changed default attributes from data-test to class, normalized values, added enum-backed class tests, introduced BackedString imports.
Form Input Components
tests/Form/InputCheckboxTest.php, tests/Form/InputDateTimeLocalTest.php, tests/Form/InputEmailTest.php, tests/Form/InputFileTest.php, tests/Form/InputHiddenTest.php, tests/Form/InputImageTest.php, tests/Form/InputMonthTest.php, tests/Form/InputNumberTest.php, tests/Form/InputPasswordTest.php, tests/Form/InputRadioTest.php, tests/Form/InputRangeTest.php, tests/Form/InputResetTest.php, tests/Form/InputSearchTest.php, tests/Form/InputSubmitTest.php, tests/Form/InputTelTest.php, tests/Form/InputTextTest.php, tests/Form/InputTimeTest.php, tests/Form/InputUrlTest.php, tests/Form/InputWeekTest.php
Added Type enum import to all input tests, introduced testGetAttributesReturnsAssignedAttributes and testRenderWithClassUsingEnum across all components, normalized attribute expectations to "value", updated template rendering tests.
Heading Components
tests/Heading/H1Test.php, tests/Heading/H2Test.php, tests/Heading/H3Test.php, tests/Heading/H4Test.php, tests/Heading/H5Test.php, tests/Heading/H6Test.php, tests/Heading/HGroupTest.php
Standardized default attribute path (class/value instead of data-test/default), normalized aria attributes (aria-pressed → aria-label), updated enum expectations across all heading levels.
List Components
tests/List/DdTest.php, tests/List/DlTest.php, tests/List/DtTest.php, tests/List/LiTest.php, tests/List/OlTest.php, tests/List/UlTest.php
Updated attribute keys and defaults for list elements, normalized test values, adjusted enum-based attribute handling and rendering expectations.
Metadata Components
tests/Metadata/BaseTest.php, tests/Metadata/LinkTest.php, tests/Metadata/MetaTest.php, tests/Metadata/NoScriptTest.php, tests/Metadata/ScriptTest.php, tests/Metadata/StyleTest.php, tests/Metadata/TemplateTest.php, tests/Metadata/TitleTest.php
Added enum support (AsValue, Rel, Type, Charset, HttpEquiv), normalized attribute expectations, updated Meta class API for charset/httpEquiv parameters, standardized test values across metadata elements.
Palpable and Phrasing Components
tests/Palpable/ATest.php, tests/Phrasing/ITest.php, tests/Phrasing/LabelTest.php, tests/Phrasing/SpanTest.php
Normalized attribute keys and values, added Type enum support in ATest, standardized aria/data attribute handling and content encoding expectations.
Root and Sectioning Components
tests/Root/BodyTest.php, tests/Root/FooterTest.php, tests/Root/HeadTest.php, tests/Root/HeaderTest.php, tests/Root/HtmlTest.php, tests/Sectioning/ArticleTest.php, tests/Sectioning/AsideTest.php, tests/Sectioning/NavTest.php, tests/Sectioning/SectionTest.php
Updated attribute handling across root and sectioning elements: changed default attributes from data-test to class, normalized enum usage, standardized aria attributes and value expectations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

The changes, while extensive in file count (~45 test files), follow a highly repetitive and consistent pattern across all files: replacing data-test attributes with class, normalizing test values to generic placeholders like "value", adding BackedString and Type imports, and introducing nearly identical new test methods. This homogeneous nature of changes significantly reduces the cognitive load despite the large scope, making the review straightforward once the pattern is understood.

Possibly related PRs

Suggested labels

bug

Poem

🐰 A rabbit's ode to test clarity

Test values once scattered, now neat,
From data-test to class, the defaults align,
With "value" as placeholder so sweet,
Each test now follows the same design,
Consistency blooms—standardized and fine! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: standardizing tests for clarity and consistency, which aligns with the extensive test updates documented in the raw summary.
Description check ✅ Passed The description relates to the changeset by indicating it is a test bugfix that does not break backward compatibility, matching the nature of the test standardization changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_mini_12

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added the bug Something isn't working label Feb 21, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (12)
tests/List/LiTest.php (1)

498-511: ⚠️ Potential issue | 🟡 Minor

testRenderWithoutValue is now a duplicate of testRenderWithContent.

After changing lines 503–507 to use ->content('value'), this method is functionally identical to testRenderWithContent (lines 244–257) — same factory call, same expected HTML output, only the assertion message differs.

The original intent of testRenderWithoutValue was almost certainly to verify that a <li> element renders without a value HTML attribute, as a counterpart to testRenderWithValue. The method should either be removed (the scenario is already covered) or corrected to test a distinct case — for example, a bare Li::tag()->render() with no value attribute set:

🛠️ Proposed fix to restore distinct intent
 public function testRenderWithoutValue(): void
 {
     self::assertSame(
         <<<HTML
         <li>
         </li>
         HTML,
         Li::tag()
-            ->content('value')
             ->render(),
         "Failed asserting that element renders correctly without 'value' attribute.",
     );
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/List/LiTest.php` around lines 498 - 511, testRenderWithoutValue is now
a duplicate of testRenderWithContent; restore its original distinct intent by
changing the test to render a bare Li::tag() with no content or value attribute
and assert the empty <li> output (i.e. call Li::tag()->render() instead of
->content('value')) so it verifies rendering without a value attribute rather
than duplicating testRenderWithContent.
tests/List/OlTest.php (2)

404-424: ⚠️ Potential issue | 🟡 Minor

SimpleFactory::setDefaults() reset is not guarded by try/finally.

If assertSame() throws (assertion failure), the trailing SimpleFactory::setDefaults(Ol::class, []) call is skipped, leaving global state dirty and potentially contaminating subsequent tests. This is a pre-existing pattern, but worth addressing with a try/finally.

🛡️ Proposed fix (same pattern for both affected methods)
     SimpleFactory::setDefaults(
         Ol::class,
         ['class' => 'default-class'],
     );

+    try {
         self::assertSame(
             <<<HTML
             <ol class="default-class">
             </ol>
             HTML,
             Ol::tag()->render(),
             'Failed asserting that global defaults are applied correctly.',
         );
+    } finally {
+        SimpleFactory::setDefaults(
+            Ol::class,
+            [],
+        );
+    }
-
-    SimpleFactory::setDefaults(
-        Ol::class,
-        [],
-    );

Also applies to: 832-855

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/List/OlTest.php` around lines 404 - 424, The test
testRenderWithGlobalDefaultsAreApplied sets global defaults via
SimpleFactory::setDefaults(Ol::class, ...) but resets them unguarded at the end,
which can leave global state dirty if the assertion fails; wrap the assertion
and any code that relies on the defaults in a try/finally and move the trailing
SimpleFactory::setDefaults(Ol::class, []) into the finally block so the reset
always runs even on assertion failures (apply the same pattern to the other
affected tests mentioned).

273-285: 🧹 Nitpick | 🔵 Trivial

*UsingEnum assertion messages no longer distinguish the enum code path.

After the standardization, testRenderWithContentEditableUsingEnum, testRenderWithDirUsingEnum, testRenderWithDraggableUsingEnum, testRenderWithLangUsingEnum, testRenderWithRoleUsingEnum, testRenderWithSetAttributeUsingEnum, and testRenderWithTranslateUsingEnum all carry messages identical to their scalar counterparts. A failure output will say e.g. "Failed asserting that element renders correctly with 'dir' attribute." without indicating it was the enum variant that failed.

Consider retaining enum in the message to preserve diagnostics:

🔧 Example for testRenderWithDirUsingEnum (same pattern for all seven methods)
-            "Failed asserting that element renders correctly with 'dir' attribute.",
+            "Failed asserting that element renders correctly with 'dir' attribute using enum.",

Also applies to: 343-355, 371-383, 485-497, 643-655, 671-683, 818-830

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/List/OlTest.php` around lines 273 - 285, Update the failure messages
for the enum-based tests so they indicate the enum code path: change the
assertion messages in testRenderWithContentEditableUsingEnum,
testRenderWithDirUsingEnum, testRenderWithDraggableUsingEnum,
testRenderWithLangUsingEnum, testRenderWithRoleUsingEnum,
testRenderWithSetAttributeUsingEnum, and testRenderWithTranslateUsingEnum to
include "using enum" or "UsingEnum" (e.g., "Failed asserting that element
renders correctly with 'contentEditable' attribute using enum.") so failures
clearly distinguish the enum variant from the scalar variant.
tests/Phrasing/LabelTest.php (1)

502-513: ⚠️ Potential issue | 🟡 Minor

Correct the style attribute expectation to use double quotes, consistent with all other attributes in this test class.

Line 506 expects <label style='value'></label> with single quotes, but every other attribute test in this file uses double quotes (e.g., id="value", class="value", for="value"). This inconsistency will cause the test to fail when the renderer outputs the standard double-quoted format.

Change:

<label style='value'></label>

to:

<label style="value"></label>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Phrasing/LabelTest.php` around lines 502 - 513, The test expectation in
testRenderWithStyle is using single quotes for the style attribute which is
inconsistent with the renderer's double-quoted output; update the expected HTML
string in testRenderWithStyle (the assertion comparing the heredoc to
Label::tag()->style('value')->render()) to use double quotes for the style
attribute: change "<label style='value'></label>" to "<label
style=\"value\"></label>" so the expected string matches the renderer's format.
tests/Metadata/StyleTest.php (1)

851-875: ⚠️ Potential issue | 🟠 Major

$style->blocking('') will throw InvalidArgumentException rather than returning a new instance.

The test testThrowInvalidArgumentExceptionForSettingBlocking proves that blocking() validates against Blocking::cases(). Since the empty string '' is not a valid Blocking enum case, the call will throw before the assertNotSame assertion is evaluated, causing an unexpected test failure. Use a known-valid enum value such as Blocking::RENDER instead.

Suggested fix
         self::assertNotSame(
             $style,
-            $style->blocking(''),
+            $style->blocking(Blocking::RENDER),
             'Should return a new instance when setting the attribute, ensuring immutability.',
         );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Metadata/StyleTest.php` around lines 851 - 875, The test
testReturnNewInstanceWhenSettingAttribute uses Style::blocking('') which throws
InvalidArgumentException because '' is not a valid Blocking enum case; change
the call to use a known-valid enum value (e.g. Blocking::RENDER) so
Style::blocking(...) returns a new instance instead of throwing; update the
assertion that calls $style->blocking(...) and import/reference the Blocking
enum where needed while leaving the other assertions (media, nonce, type)
unchanged.
tests/Form/InputResetTest.php (1)

535-546: ⚠️ Potential issue | 🟡 Minor

testRenderWithId is now a duplicate of testRenderWithDefaultValues.

After changing line 542 to ->id('inputreset'), this test renders <input id="inputreset" type="reset"> — exactly the same output as testRenderWithDefaultValues (Lines 412–423). The two methods are now functionally identical; only their assertion message differs. testRenderWithId should exercise the id() method with a value that differs from the auto-generated default (e.g., 'value', consistent with the PR's standardization) to provide distinct test coverage.

🛠 Proposed fix
     public function testRenderWithId(): void
     {
         self::assertSame(
             <<<HTML
-            <input id="inputreset" type="reset">
+            <input id="value" type="reset">
             HTML,
             InputReset::tag()
-                ->id('inputreset')
+                ->id('value')
                 ->render(),
             "Failed asserting that element renders correctly with 'id' attribute.",
         );
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Form/InputResetTest.php` around lines 535 - 546, The test
testRenderWithId duplicates testRenderWithDefaultValues because it sets
->id('inputreset') which matches the default output; change the id value used in
testRenderWithId to a non-default (e.g., 'value') and update the expected
HEREDOC to "<input id=\"value\" type=\"reset\">" so
InputReset::tag()->id('value')->render() is asserted against a distinct output
from testRenderWithDefaultValues.
tests/Heading/H3Test.php (1)

527-540: ⚠️ Potential issue | 🟡 Minor

Missed standardization: testRenderWithRemoveDataAttribute still uses 'test' as data value.

While this method was not modified in this PR, its data value 'test' is inconsistent with the 'value' placeholder adopted everywhere else in the suite (including HtmlTest.php, HGroupTest.php, NavTest.php, PTest.php). Since this PR's stated goal is full-suite standardization, this method should also be aligned.

🛠 Proposed fix
-            H3::tag()
-                ->addDataAttribute('value', 'test')
-                ->removeDataAttribute('value')
+            H3::tag()
+                ->addDataAttribute('value', 'value')
+                ->removeDataAttribute('value')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Heading/H3Test.php` around lines 527 - 540, The test
testRenderWithRemoveDataAttribute uses the literal 'test' for the data attribute
value instead of the standardized 'value' placeholder; update the H3 test to
call H3::tag()->addDataAttribute('value',
'value')->removeDataAttribute('value')->render() (i.e., replace the second
argument 'test' with 'value') so the test matches the suite-wide standard while
keeping the same call sequence to addDataAttribute and removeDataAttribute.
tests/Heading/H1Test.php (1)

527-540: ⚠️ Potential issue | 🟡 Minor

Missed standardization: testRenderWithRemoveDataAttribute still uses 'test' as data value.

Same issue as H3Test.php — the value 'test' in ->addDataAttribute('value', 'test') is inconsistent with the 'value' placeholder used in every other test file in this PR.

🛠 Proposed fix
-            H1::tag()
-                ->addDataAttribute('value', 'test')
-                ->removeDataAttribute('value')
+            H1::tag()
+                ->addDataAttribute('value', 'value')
+                ->removeDataAttribute('value')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Heading/H1Test.php` around lines 527 - 540, Update the
testRenderWithRemoveDataAttribute unit test to use the standardized placeholder
value instead of the literal 'test'; locate the call chain in the H1 test
(method testRenderWithRemoveDataAttribute) where
H1::tag()->addDataAttribute('value', 'test') is used and replace the second
argument with the placeholder 'value' so it matches the other tests that use
->addDataAttribute('value', 'value')->removeDataAttribute('value')->render().
tests/Form/InputUrlTest.php (1)

300-309: ⚠️ Potential issue | 🟡 Minor

Use attributes() in testRenderWithAttributes to avoid duplicate coverage.

testRenderWithAttributes currently calls class('value'), which is already covered by testRenderWithClass. Switching to attributes(['class' => 'value']) (or renaming the test/message) keeps the test aligned with the method under test.

🛠️ Suggested fix
-            InputUrl::tag()
-                ->class('value')
+            InputUrl::tag()
+                ->attributes(['class' => 'value'])
                 ->id('inputurl')
                 ->render(),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Form/InputUrlTest.php` around lines 300 - 309, The test
testRenderWithAttributes duplicates coverage of class() from
testRenderWithClass; update the test to call
InputUrl::tag()->attributes(['class' => 'value'])->id('inputurl')->render()
instead of ->class('value') so it exercises the attributes() path (or
alternatively rename the test/message to reflect it's covering class()),
referencing the test method testRenderWithAttributes and the InputUrl::tag(),
class(), attributes() usage.
tests/Metadata/MetaTest.php (1)

10-20: ⚠️ Potential issue | 🔴 Critical

Add missing Charset and HttpEquiv enums and HasCharset/HttpEquiv trait implementations.

Tests import and use Charset::UTF_8 and HttpEquiv::REFRESH enums, and the Meta class declares it uses HasCharset and HasHttpEquiv traits, but none of these exist in production code (src/). The UIAwesome\Html\Attribute\Values\ namespace and UIAwesome\Html\Attribute\ directory are missing entirely. These must be implemented in src/ for tests to pass and avoid import errors on branches containing only test changes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Metadata/MetaTest.php` around lines 10 - 20, Tests reference missing
enums and traits: add the UIAwesome\Html\Attribute\Values\Charset enum with at
least a UTF_8 value and the HttpEquiv enum with at least a REFRESH value, and
create the HasCharset and HasHttpEquiv traits used by the Meta class to
expose/get/set those attributes; place these under the
UIAwesome\Html\Attribute\Values and UIAwesome\Html\Attribute namespaces
respectively so imports like Charset::UTF_8, HttpEquiv::REFRESH, HasCharset,
HasHttpEquiv and the Meta class resolve correctly, and ensure trait method
names/signatures match how Meta uses them.
tests/Form/InputEmailTest.php (1)

251-266: ⚠️ Potential issue | 🟡 Minor

Use ariaAttributes() in the aria-attributes test.

The test name/message indicate ariaAttributes(), but the current code calls attributes() with full aria-* keys, so the intended API isn’t covered.

🛠️ Suggested fix
-            InputEmail::tag()
-                ->attributes(
-                    [
-                        'aria-controls' => 'value',
-                        'aria-label' => 'value',
-                    ],
-                )
+            InputEmail::tag()
+                ->ariaAttributes(
+                    [
+                        'controls' => 'value',
+                        'label' => 'value',
+                    ],
+                )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Form/InputEmailTest.php` around lines 251 - 266, The test
testRenderWithAriaAttributes currently calls
InputEmail::tag()->attributes([...]) with aria-* keys but should exercise the
ariaAttributes() API; update the assertion setup to call
InputEmail::tag()->ariaAttributes(['controls' => 'value','label' => 'value'])
(or use the exact method signature of ariaAttributes on the InputEmail tag) then
->id('inputemail')->render() so the test validates the intended ariaAttributes()
behavior instead of generic attributes().
tests/Heading/H5Test.php (1)

527-540: 🧹 Nitpick | 🔵 Trivial

Nit: 'test' is inconsistent with the standardized 'value' placeholder used across all other tests in this PR.

Since the attribute is removed immediately the result is identical, but the value deviates from the uniform 'value' placeholder established by this PR.

♻️ Suggested fix
-                ->addDataAttribute('value', 'test')
+                ->addDataAttribute('value', 'value')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Heading/H5Test.php` around lines 527 - 540, Update the test
testRenderWithRemoveDataAttribute so the placeholder value passed to
H5::tag()->addDataAttribute(...) matches the standardized 'value' used
elsewhere; specifically change the literal 'test' used in the call to
addDataAttribute('value', 'test') to 'value' (i.e., addDataAttribute('value',
'value')), leaving removeDataAttribute('value') and the rest of the assertion
unchanged.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6210a52 and 328539f.

📒 Files selected for processing (59)
  • CHANGELOG.md
  • tests/Embedded/ImgTest.php
  • tests/Flow/DivTest.php
  • tests/Flow/HrTest.php
  • tests/Flow/MainTest.php
  • tests/Flow/PTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputDateTimeLocalTest.php
  • tests/Form/InputEmailTest.php
  • tests/Form/InputFileTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Form/InputImageTest.php
  • tests/Form/InputMonthTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputPasswordTest.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputRangeTest.php
  • tests/Form/InputResetTest.php
  • tests/Form/InputSearchTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Form/InputTelTest.php
  • tests/Form/InputTextTest.php
  • tests/Form/InputTimeTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputWeekTest.php
  • tests/Heading/H1Test.php
  • tests/Heading/H2Test.php
  • tests/Heading/H3Test.php
  • tests/Heading/H4Test.php
  • tests/Heading/H5Test.php
  • tests/Heading/H6Test.php
  • tests/Heading/HGroupTest.php
  • tests/List/DdTest.php
  • tests/List/DlTest.php
  • tests/List/DtTest.php
  • tests/List/LiTest.php
  • tests/List/OlTest.php
  • tests/List/UlTest.php
  • tests/Metadata/BaseTest.php
  • tests/Metadata/LinkTest.php
  • tests/Metadata/MetaTest.php
  • tests/Metadata/NoScriptTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Metadata/StyleTest.php
  • tests/Metadata/TemplateTest.php
  • tests/Metadata/TitleTest.php
  • tests/Palpable/ATest.php
  • tests/Phrasing/ITest.php
  • tests/Phrasing/LabelTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Root/BodyTest.php
  • tests/Root/FooterTest.php
  • tests/Root/HeadTest.php
  • tests/Root/HeaderTest.php
  • tests/Root/HtmlTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Sectioning/NavTest.php
  • tests/Sectioning/SectionTest.php
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 24
File: tests/Form/InputTextTest.php:33-620
Timestamp: 2026-02-06T21:37:51.711Z
Learning: In the ui-awesome/html repository, prefer individual test methods over PHPUnit data providers in test classes. The maintainer values the ability to see exactly how each test works without needing to cross-reference data providers, even if it results in more methods.
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 35
File: tests/Provider/Form/CheckedProvider.php:13-14
Timestamp: 2026-02-09T11:28:09.334Z
Learning: In the ui-awesome/html repository, using `str_replace` to adapt shared data provider HTML strings for different input types (e.g., adapting `CheckedProvider` for both `InputCheckboxTest` and `InputRadioTest` by replacing "inputcheckbox-" with "inputradio-" and "checkbox" with "radio") is acceptable and considered clear. Don't suggest refactoring such patterns to avoid string replacement.
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 37
File: tests/Form/InputTextTest.php:448-457
Timestamp: 2026-02-11T14:56:26.855Z
Learning: In the ui-awesome/html repository, short variable names (e.g., 2-character names like `$id`) are acceptable in test files and should not be flagged. PHPMD's short-variable rule does not need to be strictly followed in test code.
📚 Learning: 2026-02-06T21:37:44.509Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 24
File: tests/Form/InputTextTest.php:33-620
Timestamp: 2026-02-06T21:37:44.509Z
Learning: In the ui-awesome/html repository, prefer individual test methods over PHPUnit data providers in test classes. This helps maintainers see exactly how each test behaves without cross-referencing data providers. Apply to all PHP test files under tests. Use separate, descriptively named test methods to cover different inputs/edge cases; retain data providers only if they clearly improve readability or reduce duplication.

Applied to files:

  • tests/Root/HtmlTest.php
  • tests/Heading/HGroupTest.php
  • tests/Form/InputSubmitTest.php
  • tests/List/UlTest.php
  • tests/List/DdTest.php
  • tests/Sectioning/NavTest.php
  • tests/Flow/MainTest.php
  • tests/Form/InputImageTest.php
  • tests/Form/InputRangeTest.php
  • tests/Metadata/TitleTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Form/InputTimeTest.php
  • tests/Heading/H1Test.php
  • tests/Metadata/NoScriptTest.php
  • tests/Heading/H4Test.php
  • tests/Form/InputPasswordTest.php
  • tests/Root/BodyTest.php
  • tests/Form/InputFileTest.php
  • tests/Form/InputWeekTest.php
  • tests/Form/InputTelTest.php
  • tests/Heading/H5Test.php
  • tests/Metadata/MetaTest.php
  • tests/Form/InputTextTest.php
  • tests/Phrasing/ITest.php
  • tests/Heading/H6Test.php
  • tests/Form/InputNumberTest.php
  • tests/Heading/H2Test.php
  • tests/Form/InputCheckboxTest.php
  • tests/Flow/PTest.php
  • tests/List/DtTest.php
  • tests/List/DlTest.php
  • tests/List/OlTest.php
  • tests/Metadata/BaseTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Form/InputEmailTest.php
  • tests/Sectioning/SectionTest.php
  • tests/Flow/HrTest.php
  • tests/List/LiTest.php
  • tests/Metadata/TemplateTest.php
  • tests/Root/HeaderTest.php
  • tests/Form/InputMonthTest.php
  • tests/Root/FooterTest.php
  • tests/Phrasing/LabelTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Root/HeadTest.php
  • tests/Form/InputDateTimeLocalTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Form/InputSearchTest.php
  • tests/Flow/DivTest.php
  • tests/Embedded/ImgTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputResetTest.php
  • tests/Metadata/LinkTest.php
  • tests/Form/InputRadioTest.php
  • tests/Palpable/ATest.php
  • tests/Heading/H3Test.php
  • tests/Metadata/StyleTest.php
📚 Learning: 2026-02-09T11:28:09.334Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 35
File: tests/Provider/Form/CheckedProvider.php:13-14
Timestamp: 2026-02-09T11:28:09.334Z
Learning: In the ui-awesome/html repository, using `str_replace` to adapt shared data provider HTML strings for different input types (e.g., adapting `CheckedProvider` for both `InputCheckboxTest` and `InputRadioTest` by replacing "inputcheckbox-" with "inputradio-" and "checkbox" with "radio") is acceptable and considered clear. Don't suggest refactoring such patterns to avoid string replacement.

Applied to files:

  • tests/Root/HtmlTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Form/InputImageTest.php
  • tests/Form/InputRangeTest.php
  • tests/Form/InputTimeTest.php
  • tests/Form/InputFileTest.php
  • tests/Form/InputWeekTest.php
  • tests/Form/InputTelTest.php
  • tests/Form/InputTextTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Metadata/BaseTest.php
  • tests/Form/InputEmailTest.php
  • tests/Form/InputMonthTest.php
  • tests/Form/InputDateTimeLocalTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Form/InputSearchTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputResetTest.php
  • tests/Form/InputRadioTest.php
📚 Learning: 2026-02-11T14:56:18.277Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 37
File: tests/Form/InputTextTest.php:448-457
Timestamp: 2026-02-11T14:56:18.277Z
Learning: In PHP test files under the repository ui-awesome/html (e.g., tests/Form/InputTextTest.php), it is acceptable to use short variable names (e.g., 2-character names like $id). PHPMD's short-variable rule does not need to be strictly followed in test code. During reviews, allow short names in test files and note that this relaxed style applies to tests, while production code should adhere to the standard variable naming conventions.

Applied to files:

  • tests/Root/HtmlTest.php
  • tests/Heading/HGroupTest.php
  • tests/Form/InputSubmitTest.php
  • tests/List/UlTest.php
  • tests/List/DdTest.php
  • tests/Sectioning/NavTest.php
  • tests/Flow/MainTest.php
  • tests/Form/InputImageTest.php
  • tests/Form/InputRangeTest.php
  • tests/Metadata/TitleTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Form/InputTimeTest.php
  • tests/Heading/H1Test.php
  • tests/Metadata/NoScriptTest.php
  • tests/Heading/H4Test.php
  • tests/Form/InputPasswordTest.php
  • tests/Root/BodyTest.php
  • tests/Form/InputFileTest.php
  • tests/Form/InputWeekTest.php
  • tests/Form/InputTelTest.php
  • tests/Heading/H5Test.php
  • tests/Metadata/MetaTest.php
  • tests/Form/InputTextTest.php
  • tests/Phrasing/ITest.php
  • tests/Heading/H6Test.php
  • tests/Form/InputNumberTest.php
  • tests/Heading/H2Test.php
  • tests/Form/InputCheckboxTest.php
  • tests/Flow/PTest.php
  • tests/List/DtTest.php
  • tests/List/DlTest.php
  • tests/List/OlTest.php
  • tests/Metadata/BaseTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Form/InputEmailTest.php
  • tests/Sectioning/SectionTest.php
  • tests/Flow/HrTest.php
  • tests/List/LiTest.php
  • tests/Metadata/TemplateTest.php
  • tests/Root/HeaderTest.php
  • tests/Form/InputMonthTest.php
  • tests/Root/FooterTest.php
  • tests/Phrasing/LabelTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Root/HeadTest.php
  • tests/Form/InputDateTimeLocalTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Form/InputSearchTest.php
  • tests/Flow/DivTest.php
  • tests/Embedded/ImgTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputResetTest.php
  • tests/Metadata/LinkTest.php
  • tests/Form/InputRadioTest.php
  • tests/Palpable/ATest.php
  • tests/Heading/H3Test.php
  • tests/Metadata/StyleTest.php
📚 Learning: 2026-02-07T18:51:41.006Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 31
File: src/Form/Mixin/HasLabel.php:195-195
Timestamp: 2026-02-07T18:51:41.006Z
Learning: In the ui-awesome/html repository, explicit boolean comparisons (e.g., `isset($var) === false`) are required instead of negation operators (e.g., `!isset($var)`) due to PHPStan strict rules configuration at the highest level.

Applied to files:

  • tests/Metadata/MetaTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Metadata/BaseTest.php
  • tests/Form/InputDateTimeLocalTest.php
  • tests/Metadata/LinkTest.php
🧬 Code graph analysis (49)
tests/Heading/HGroupTest.php (2)
src/Heading/HGroup.php (1)
  • HGroup (29-42)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Form/InputSubmitTest.php (3)
src/Form/InputSubmit.php (1)
  • InputSubmit (37-80)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
src/Form/Attribute/HasFormtarget.php (1)
  • formtarget (34-37)
tests/List/UlTest.php (1)
src/List/Ul.php (3)
  • Ul (28-94)
  • items (46-55)
  • li (72-81)
tests/List/DdTest.php (2)
src/List/Dd.php (1)
  • Dd (26-39)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Sectioning/NavTest.php (1)
src/Sectioning/Nav.php (1)
  • Nav (27-40)
tests/Flow/MainTest.php (13)
src/Flow/Main.php (1)
  • Main (27-40)
tests/Form/InputCheckboxTest.php (1)
  • testRenderWithClassUsingEnum (396-408)
tests/Form/InputHiddenTest.php (1)
  • testRenderWithClassUsingEnum (380-392)
tests/Form/InputNumberTest.php (1)
  • testRenderWithClassUsingEnum (396-408)
tests/Form/InputPasswordTest.php (1)
  • testRenderWithClassUsingEnum (397-409)
tests/Form/InputRadioTest.php (1)
  • testRenderWithClassUsingEnum (405-417)
tests/Form/InputRangeTest.php (1)
  • testRenderWithClassUsingEnum (395-407)
tests/Form/InputResetTest.php (1)
  • testRenderWithClassUsingEnum (357-369)
tests/Form/InputSearchTest.php (1)
  • testRenderWithClassUsingEnum (394-406)
tests/Form/InputSubmitTest.php (1)
  • testRenderWithClassUsingEnum (357-369)
tests/Form/InputTelTest.php (1)
  • testRenderWithClassUsingEnum (396-408)
tests/Form/InputTextTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
tests/Form/InputWeekTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
tests/Form/InputImageTest.php (4)
src/Form/InputImage.php (1)
  • InputImage (41-86)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
src/Form/Attribute/HasFormtarget.php (1)
  • formtarget (34-37)
tests/Embedded/ImgTest.php (1)
  • testRenderWithSrc (684-695)
tests/Metadata/TitleTest.php (2)
src/Metadata/Title.php (1)
  • Title (26-39)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Sectioning/AsideTest.php (2)
src/Sectioning/Aside.php (1)
  • Aside (27-40)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Heading/H1Test.php (2)
src/Heading/H1.php (1)
  • H1 (27-40)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Metadata/NoScriptTest.php (1)
src/Metadata/NoScript.php (1)
  • NoScript (26-39)
tests/Heading/H4Test.php (2)
src/Heading/H4.php (1)
  • H4 (27-40)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Root/BodyTest.php (4)
src/Root/Body.php (1)
  • Body (27-40)
tests/Root/HtmlTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Flow/MainTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (60-69)
  • testRenderWithSetAttribute (600-612)
tests/Form/InputFileTest.php (2)
src/Form/InputFile.php (2)
  • InputFile (43-139)
  • getAttributes (61-70)
src/Form/Attribute/HasCapture.php (1)
  • capture (35-38)
tests/Form/InputWeekTest.php (2)
src/Form/InputWeek.php (1)
  • InputWeek (51-96)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
tests/Form/InputTelTest.php (2)
src/Form/InputTel.php (1)
  • InputTel (46-94)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
tests/Heading/H5Test.php (5)
src/Heading/H5.php (1)
  • H5 (27-40)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Heading/H1Test.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Heading/H2Test.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Heading/H3Test.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Metadata/MetaTest.php (1)
src/Metadata/Meta.php (1)
  • Meta (28-47)
tests/Form/InputTextTest.php (2)
src/Form/InputText.php (1)
  • InputText (45-94)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
tests/Phrasing/ITest.php (4)
src/Phrasing/I.php (1)
  • I (27-50)
tests/Embedded/ImgTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (645-656)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Phrasing/SpanTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (57-66)
  • testRenderWithSetAttribute (461-472)
tests/Heading/H6Test.php (2)
src/Heading/H6.php (1)
  • H6 (27-40)
tests/Heading/H1Test.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Form/InputNumberTest.php (2)
src/Form/InputNumber.php (1)
  • InputNumber (44-90)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
tests/Heading/H2Test.php (1)
src/Heading/H2.php (1)
  • H2 (27-40)
tests/Form/InputCheckboxTest.php (4)
src/Root/Html.php (1)
  • Html (27-40)
src/Form/InputCheckbox.php (1)
  • InputCheckbox (31-57)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
src/Form/Mixin/CanBeEnclosedByLabel.php (1)
  • enclosedByLabel (32-38)
tests/Flow/PTest.php (4)
src/Flow/P.php (1)
  • P (27-40)
tests/Form/InputTelTest.php (1)
  • testRenderWithClassUsingEnum (396-408)
tests/Form/InputTextTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
tests/Form/InputWeekTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
tests/List/DtTest.php (4)
src/List/Dt.php (1)
  • Dt (26-39)
tests/Embedded/ImgTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (645-656)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Heading/H1Test.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/List/DlTest.php (4)
tests/Embedded/ImgTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (645-656)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Flow/PTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (60-69)
  • testRenderWithSetAttribute (600-612)
tests/Heading/H1Test.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/List/OlTest.php (3)
src/List/Ol.php (3)
  • Ol (31-100)
  • items (52-61)
  • li (78-87)
src/List/Ul.php (2)
  • items (46-55)
  • li (72-81)
src/List/Attribute/HasReversed.php (1)
  • reversed (30-33)
tests/Metadata/ScriptTest.php (1)
src/Metadata/Script.php (1)
  • Script (37-61)
tests/Form/InputEmailTest.php (1)
src/Form/InputEmail.php (1)
  • InputEmail (47-96)
tests/Sectioning/SectionTest.php (2)
src/Sectioning/Section.php (1)
  • Section (27-40)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Flow/HrTest.php (4)
tests/Heading/H1Test.php (1)
  • testGetAttributesReturnsAssignedAttributes (59-68)
src/Root/Html.php (1)
  • Html (27-40)
src/Flow/Hr.php (1)
  • Hr (26-39)
tests/Form/InputTextTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
tests/Metadata/TemplateTest.php (6)
src/Metadata/Template.php (1)
  • Template (33-52)
tests/Root/HtmlTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Embedded/ImgTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (645-656)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Flow/MainTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (60-69)
  • testRenderWithSetAttribute (600-612)
src/Metadata/Attribute/HasShadowRootReferenceTarget.php (1)
  • shadowRootReferenceTarget (35-38)
tests/Root/HeaderTest.php (5)
src/Root/Header.php (1)
  • Header (27-40)
tests/Root/FooterTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Root/HtmlTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Flow/MainTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (60-69)
  • testRenderWithSetAttribute (600-612)
tests/Form/InputMonthTest.php (2)
src/Form/InputMonth.php (1)
  • InputMonth (52-97)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
tests/Root/FooterTest.php (1)
src/Root/Footer.php (1)
  • Footer (27-40)
tests/Phrasing/LabelTest.php (1)
src/Phrasing/Label.php (2)
  • Label (27-68)
  • for (42-45)
tests/Phrasing/SpanTest.php (2)
src/Phrasing/Span.php (1)
  • Span (27-50)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Root/HeadTest.php (5)
src/Root/Head.php (1)
  • Head (26-39)
tests/Root/FooterTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Root/HtmlTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Flow/MainTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (60-69)
  • testRenderWithSetAttribute (600-612)
tests/Form/InputDateTimeLocalTest.php (2)
src/Form/InputDateTimeLocal.php (1)
  • InputDateTimeLocal (51-96)
tests/Form/InputRadioTest.php (1)
  • testGetAttributesReturnsAssignedAttributes (48-62)
tests/Form/InputSearchTest.php (2)
src/Form/InputSearch.php (1)
  • InputSearch (49-98)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
tests/Flow/DivTest.php (15)
src/Flow/Div.php (1)
  • Div (27-40)
tests/Flow/MainTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (60-69)
  • testRenderWithClassUsingEnum (244-256)
tests/Heading/H1Test.php (1)
  • testGetAttributesReturnsAssignedAttributes (59-68)
tests/Form/InputCheckboxTest.php (1)
  • testRenderWithClassUsingEnum (396-408)
tests/Form/InputHiddenTest.php (1)
  • testRenderWithClassUsingEnum (380-392)
tests/Form/InputNumberTest.php (1)
  • testRenderWithClassUsingEnum (396-408)
tests/Form/InputPasswordTest.php (1)
  • testRenderWithClassUsingEnum (397-409)
tests/Form/InputRadioTest.php (1)
  • testRenderWithClassUsingEnum (405-417)
tests/Form/InputRangeTest.php (1)
  • testRenderWithClassUsingEnum (395-407)
tests/Form/InputResetTest.php (1)
  • testRenderWithClassUsingEnum (357-369)
tests/Form/InputSearchTest.php (1)
  • testRenderWithClassUsingEnum (394-406)
tests/Form/InputSubmitTest.php (1)
  • testRenderWithClassUsingEnum (357-369)
tests/Form/InputTelTest.php (1)
  • testRenderWithClassUsingEnum (396-408)
tests/Form/InputTextTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
tests/Form/InputWeekTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
tests/Embedded/ImgTest.php (3)
src/Embedded/Img.php (1)
  • Img (43-71)
tests/Form/InputTextTest.php (1)
  • testRenderWithClassUsingEnum (398-410)
src/Embedded/Attribute/HasElementtiming.php (1)
  • elementtiming (34-37)
tests/Form/InputUrlTest.php (2)
src/Form/InputUrl.php (1)
  • InputUrl (46-94)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
tests/Form/InputResetTest.php (1)
src/Form/InputReset.php (1)
  • InputReset (30-67)
tests/Form/InputRadioTest.php (3)
src/Form/InputRadio.php (1)
  • InputRadio (31-57)
src/Form/Base/BaseChoice.php (1)
  • getAttributes (48-51)
src/Form/Mixin/CanBeEnclosedByLabel.php (1)
  • enclosedByLabel (32-38)
tests/Palpable/ATest.php (4)
src/Palpable/A.php (1)
  • A (37-69)
tests/Metadata/LinkTest.php (1)
  • testRenderWithTypeUsingEnum (811-822)
tests/Metadata/ScriptTest.php (1)
  • testRenderWithTypeUsingEnum (942-954)
tests/Metadata/StyleTest.php (1)
  • testRenderWithTypeUsingEnum (812-824)
tests/Heading/H3Test.php (2)
tests/Root/HtmlTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (59-68)
  • testRenderWithSetAttribute (585-597)
tests/Flow/HrTest.php (2)
  • testGetAttributesReturnsAssignedAttributes (39-48)
  • testRenderWithSetAttribute (430-441)
tests/Metadata/StyleTest.php (4)
src/Metadata/Style.php (1)
  • Style (28-46)
tests/Metadata/LinkTest.php (1)
  • testRenderWithTypeUsingEnum (811-822)
tests/Metadata/ScriptTest.php (1)
  • testRenderWithTypeUsingEnum (942-954)
tests/Palpable/ATest.php (1)
  • testRenderWithTypeUsingEnum (743-754)
🪛 PHPMD (2.15.0)
tests/Form/InputTimeTest.php

[error] 986-992: Avoid using static access to class '\UIAwesome\Html\Core\Factory\SimpleFactory' in method 'testRenderWithUserOverridesGlobalDefaults'. (undefined)

(StaticAccess)

tests/Metadata/NoScriptTest.php

[error] 224-224: Avoid using static access to class '\UIAwesome\Html\Metadata\NoScript' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)

tests/Metadata/MetaTest.php

[error] 651-651: Avoid using static access to class '\UIAwesome\Html\Helper\Enum' in method 'testThrowInvalidArgumentExceptionForSettingHttpEquiv'. (undefined)

(StaticAccess)


[error] 651-651: Avoid using static access to class '\UIAwesome\Html\Attribute\Values\HttpEquiv' in method 'testThrowInvalidArgumentExceptionForSettingHttpEquiv'. (undefined)

(StaticAccess)

tests/Metadata/ScriptTest.php

[error] 249-249: Avoid using static access to class '\UIAwesome\Html\Metadata\Script' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)

tests/Form/InputUrlTest.php

[error] 1000-1006: Avoid using static access to class '\UIAwesome\Html\Core\Factory\SimpleFactory' in method 'testRenderWithUserOverridesGlobalDefaults'. (undefined)

(StaticAccess)


[error] 1016-1019: Avoid using static access to class '\UIAwesome\Html\Core\Factory\SimpleFactory' in method 'testRenderWithUserOverridesGlobalDefaults'. (undefined)

(StaticAccess)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: phpunit / PHP 8.4-ubuntu-latest
  • GitHub Check: linter / Super Linter
  • GitHub Check: linter / Super Linter
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/Form/InputDateTimeLocalTest.php`:
- Around line 900-914: The assertion message in testRenderWithTemplate is
misleading; update the failure message passed to assertSame in the test method
testRenderWithTemplate to accurately describe what's being tested (e.g., that
the element renders correctly with a custom wrapper template) by editing the
message string after InputDateTimeLocal::tag()->template(...)->render() to
remove "enclosed label" and reflect the custom template behavior.

In `@tests/Form/InputResetTest.php`:
- Around line 734-748: The assertion message in the testRenderWithTemplate test
is misleading; update the final assertion message string (in the
testRenderWithTemplate method that calls
InputReset::tag()->id('inputreset')->template(...)->render()) to accurately
describe this test (e.g., "Failed asserting that element renders correctly with
custom template." or similar) so it no longer references an enclosed label; keep
the rest of the assertion unchanged.

In `@tests/Form/InputSearchTest.php`:
- Around line 925-939: Update the failing assertion message in the
testRenderWithTemplate method to accurately describe what's being tested:
replace the misleading text "'Failed asserting that element renders correctly
with enclosed label and custom template.'" with a message that references the
custom template (e.g., "'Failed asserting that element renders correctly with
custom template.'") so it no longer mentions a label; locate the assertion
inside testRenderWithTemplate that compares the heredoc HTML to
InputSearch::tag()->id('inputsearch')->template(...)->render() and change only
the message string.

In `@tests/List/UlTest.php`:
- Around line 282-283: The failure message for the test methods named like
testRenderWith*UsingEnum currently duplicates their non-enum siblings; update
each assertSame call in the testRenderWith*UsingEnum methods (the ones at the
pairs mentioned) to include a distinguishing phrase such as "using enum" (e.g.,
change "Failed asserting that element renders correctly with 'contentEditable'
attribute." to "Failed asserting that element renders correctly with
'contentEditable' attribute (using enum)." ) so each *UsingEnum test has a
unique assertion message for faster triage; apply the same pattern to all
affected testRenderWith*UsingEnum methods referenced in the comment.

---

Outside diff comments:
In `@tests/Form/InputEmailTest.php`:
- Around line 251-266: The test testRenderWithAriaAttributes currently calls
InputEmail::tag()->attributes([...]) with aria-* keys but should exercise the
ariaAttributes() API; update the assertion setup to call
InputEmail::tag()->ariaAttributes(['controls' => 'value','label' => 'value'])
(or use the exact method signature of ariaAttributes on the InputEmail tag) then
->id('inputemail')->render() so the test validates the intended ariaAttributes()
behavior instead of generic attributes().

In `@tests/Form/InputResetTest.php`:
- Around line 535-546: The test testRenderWithId duplicates
testRenderWithDefaultValues because it sets ->id('inputreset') which matches the
default output; change the id value used in testRenderWithId to a non-default
(e.g., 'value') and update the expected HEREDOC to "<input id=\"value\"
type=\"reset\">" so InputReset::tag()->id('value')->render() is asserted against
a distinct output from testRenderWithDefaultValues.

In `@tests/Form/InputUrlTest.php`:
- Around line 300-309: The test testRenderWithAttributes duplicates coverage of
class() from testRenderWithClass; update the test to call
InputUrl::tag()->attributes(['class' => 'value'])->id('inputurl')->render()
instead of ->class('value') so it exercises the attributes() path (or
alternatively rename the test/message to reflect it's covering class()),
referencing the test method testRenderWithAttributes and the InputUrl::tag(),
class(), attributes() usage.

In `@tests/Heading/H1Test.php`:
- Around line 527-540: Update the testRenderWithRemoveDataAttribute unit test to
use the standardized placeholder value instead of the literal 'test'; locate the
call chain in the H1 test (method testRenderWithRemoveDataAttribute) where
H1::tag()->addDataAttribute('value', 'test') is used and replace the second
argument with the placeholder 'value' so it matches the other tests that use
->addDataAttribute('value', 'value')->removeDataAttribute('value')->render().

In `@tests/Heading/H3Test.php`:
- Around line 527-540: The test testRenderWithRemoveDataAttribute uses the
literal 'test' for the data attribute value instead of the standardized 'value'
placeholder; update the H3 test to call H3::tag()->addDataAttribute('value',
'value')->removeDataAttribute('value')->render() (i.e., replace the second
argument 'test' with 'value') so the test matches the suite-wide standard while
keeping the same call sequence to addDataAttribute and removeDataAttribute.

In `@tests/Heading/H5Test.php`:
- Around line 527-540: Update the test testRenderWithRemoveDataAttribute so the
placeholder value passed to H5::tag()->addDataAttribute(...) matches the
standardized 'value' used elsewhere; specifically change the literal 'test' used
in the call to addDataAttribute('value', 'test') to 'value' (i.e.,
addDataAttribute('value', 'value')), leaving removeDataAttribute('value') and
the rest of the assertion unchanged.

In `@tests/List/LiTest.php`:
- Around line 498-511: testRenderWithoutValue is now a duplicate of
testRenderWithContent; restore its original distinct intent by changing the test
to render a bare Li::tag() with no content or value attribute and assert the
empty <li> output (i.e. call Li::tag()->render() instead of ->content('value'))
so it verifies rendering without a value attribute rather than duplicating
testRenderWithContent.

In `@tests/List/OlTest.php`:
- Around line 404-424: The test testRenderWithGlobalDefaultsAreApplied sets
global defaults via SimpleFactory::setDefaults(Ol::class, ...) but resets them
unguarded at the end, which can leave global state dirty if the assertion fails;
wrap the assertion and any code that relies on the defaults in a try/finally and
move the trailing SimpleFactory::setDefaults(Ol::class, []) into the finally
block so the reset always runs even on assertion failures (apply the same
pattern to the other affected tests mentioned).
- Around line 273-285: Update the failure messages for the enum-based tests so
they indicate the enum code path: change the assertion messages in
testRenderWithContentEditableUsingEnum, testRenderWithDirUsingEnum,
testRenderWithDraggableUsingEnum, testRenderWithLangUsingEnum,
testRenderWithRoleUsingEnum, testRenderWithSetAttributeUsingEnum, and
testRenderWithTranslateUsingEnum to include "using enum" or "UsingEnum" (e.g.,
"Failed asserting that element renders correctly with 'contentEditable'
attribute using enum.") so failures clearly distinguish the enum variant from
the scalar variant.

In `@tests/Metadata/MetaTest.php`:
- Around line 10-20: Tests reference missing enums and traits: add the
UIAwesome\Html\Attribute\Values\Charset enum with at least a UTF_8 value and the
HttpEquiv enum with at least a REFRESH value, and create the HasCharset and
HasHttpEquiv traits used by the Meta class to expose/get/set those attributes;
place these under the UIAwesome\Html\Attribute\Values and
UIAwesome\Html\Attribute namespaces respectively so imports like Charset::UTF_8,
HttpEquiv::REFRESH, HasCharset, HasHttpEquiv and the Meta class resolve
correctly, and ensure trait method names/signatures match how Meta uses them.

In `@tests/Metadata/StyleTest.php`:
- Around line 851-875: The test testReturnNewInstanceWhenSettingAttribute uses
Style::blocking('') which throws InvalidArgumentException because '' is not a
valid Blocking enum case; change the call to use a known-valid enum value (e.g.
Blocking::RENDER) so Style::blocking(...) returns a new instance instead of
throwing; update the assertion that calls $style->blocking(...) and
import/reference the Blocking enum where needed while leaving the other
assertions (media, nonce, type) unchanged.

In `@tests/Phrasing/LabelTest.php`:
- Around line 502-513: The test expectation in testRenderWithStyle is using
single quotes for the style attribute which is inconsistent with the renderer's
double-quoted output; update the expected HTML string in testRenderWithStyle
(the assertion comparing the heredoc to Label::tag()->style('value')->render())
to use double quotes for the style attribute: change "<label
style='value'></label>" to "<label style=\"value\"></label>" so the expected
string matches the renderer's format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant