Skip to content

fix(tests): Remove directory tests\Stub and move tests\Support\Provider to tests\Provider in tests.#74

Merged
terabytesoftw merged 1 commit into
mainfrom
fix_mini_23
Feb 5, 2026
Merged

fix(tests): Remove directory tests\Stub and move tests\Support\Provider to tests\Provider in tests.#74
terabytesoftw merged 1 commit into
mainfrom
fix_mini_23

Conversation

@terabytesoftw
Copy link
Copy Markdown
Contributor

Pull Request

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

@terabytesoftw terabytesoftw added the bug Something isn't working label Feb 5, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 5, 2026

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Extended HTML attribute methods to accept Stringable and UnitEnum types in addition to strings (including accesskey, id, lang, role, charset, download, rel, and more).
  • Refactor

    • Restructured test support directory; moved test data providers to a new namespace location.
    • Removed legacy test stub enums in favor of standardized test data providers.

Walkthrough

This PR expands attribute setter method parameter types across multiple trait classes to accept Stringable and UnitEnum in addition to string, relocates test providers from the Support\Provider namespace to a top-level Provider namespace, replaces project-specific test stub enums with shared stubs from PHPForge\Support\Stub, and updates corresponding test data providers and test methods to exercise the broadened type unions.

Changes

Cohort / File(s) Summary
Attribute Type Expansion
src/Global/HasAccesskey.php, src/Global/HasId.php, src/Global/HasLang.php, src/Global/HasMicroData.php, src/Global/HasRole.php, src/HasAs.php, src/HasCharset.php, src/HasDownload.php, src/HasHttpEquiv.php, src/HasPing.php, src/HasReferrerpolicy.php, src/HasRel.php
Widened method parameter types in attribute trait setters from string|UnitEnum|null to string|Stringable|UnitEnum|null (and variants like bool|string|Stringable|UnitEnum|null for HasDownload). Added corresponding imports and updated docblocks.
Test Import Path Updates
tests/Global/CanBeAutofocusTest.php, tests/Global/CanBeHiddenTest.php, tests/Global/Has*Test.php, tests/Has*Test.php
Updated provider import paths from Tests\Support\Provider\* to Tests\Provider\*. Multiple test class method signatures expanded to match widened parameter types accepting Stringable and UnitEnum.
Test Provider Namespace Relocation
tests/Provider/*, tests/Provider/Global/*
Relocated all test provider classes from UIAwesome\Html\Attribute\Tests\Support\Provider to UIAwesome\Html\Attribute\Tests\Provider (removed Support segment). Expanded PHPDoc return types in values() methods to include Stringable in type unions.
Test Provider Data Expansion
tests/Provider/AsProvider.php, tests/Provider/CharsetProvider.php, tests/Provider/Global/AccesskeyProvider.php, tests/Provider/Global/IdProvider.php, tests/Provider/Global/ItemIdProvider.php, tests/Provider/Global/ItemPropProvider.php, tests/Provider/Global/ItemTypeProvider.php, tests/Provider/Global/LangProvider.php, tests/Provider/Global/RoleProvider.php, tests/Provider/*/...
Added new test cases for Stringable instances and enum-backed values (BackedString::VALUE, Unit::value). Introduced anonymous Stringable implementations and expanded test data sets to cover broader type unions.
Stub Enum Replacements
tests/Provider/Global/AriaProvider.php, tests/Provider/Global/ClassProvider.php, tests/Provider/Global/DataProvider.php, tests/Provider/Global/EventProvider.php, tests/Provider/Global/NonceProvider.php, tests/Provider/Global/StyleProvider.php, tests/Provider/Global/TitleProvider.php
Replaced local stub enums (AlertType, ButtonSize, Priority, Status) with imports from PHPForge\Support\Stub (BackedString, BackedInteger, Unit). Updated test data to use new enum sources and adjusted expected values accordingly.
Removed Test Stubs
tests/Support/Stub/Values/AlertType.php, tests/Support/Stub/Values/Backed.php, tests/Support/Stub/Values/ButtonSize.php, tests/Support/Stub/Values/Priority.php, tests/Support/Stub/Values/Status.php, tests/Support/Stub/Values/Unit.php
Deleted project-specific test stub enum files, consolidating on external PHPForge stubs.
Metadata Updates
CHANGELOG.md
Added changelog entry noting the relocation of test provider scaffolding as part of Bug #74.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 Hop, hop, the types grow wide,
Stringable joins the ride,
Providers leap from Support's nest,
To Provider's cleaner test!
Stubs retire, new imports bloom,
Wider validation fills the room. 🌸

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing tests\Stub directory and moving tests\Support\Provider to tests\Provider. It is concise, specific, and clearly summarizes the primary structural refactoring in the changeset.
Description check ✅ Passed The description is related to the changeset, confirming it is a bugfix with no breaking changes. While minimal, it provides relevant context about the nature and scope of the changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_mini_23

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.

Copy link
Copy Markdown

@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: 1

Caution

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

⚠️ Outside diff range comments (1)
tests/Provider/BlockingProvider.php (1)

16-16: ⚠️ Potential issue | 🟡 Minor

Verify the copyright year wasn’t updated during the move.
If this file was moved from tests/Support/Provider, keep the original creation year in the header rather than updating it to 2026.

Based on learnings: Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories.

🤖 Fix all issues with AI agents
In `@tests/Provider/ValueProvider.php`:
- Around line 5-9: The tests import PHPForge\Support\Stub\BackedString and Unit
but the composer.json lacks the phpforge/support package; update composer.json
to add "phpforge/support" (preferably under require-dev) so BackedString and
Unit are available, or verify the package is provided by the workspace/parent
and document that; ensure composer.lock is updated and run composer install so
the ValueProvider.php imports resolve at test time.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0aa3cc4 and 7c6da76.

📒 Files selected for processing (105)
  • CHANGELOG.md
  • src/Global/HasAccesskey.php
  • src/Global/HasId.php
  • src/Global/HasLang.php
  • src/Global/HasMicroData.php
  • src/Global/HasRole.php
  • src/HasAs.php
  • src/HasCharset.php
  • src/HasDownload.php
  • src/HasHttpEquiv.php
  • src/HasPing.php
  • src/HasReferrerpolicy.php
  • src/HasRel.php
  • tests/Global/CanBeAutofocusTest.php
  • tests/Global/CanBeHiddenTest.php
  • tests/Global/HasAccesskeyTest.php
  • tests/Global/HasAriaTest.php
  • tests/Global/HasClassTest.php
  • tests/Global/HasContentEditableTest.php
  • tests/Global/HasDataTest.php
  • tests/Global/HasDirTest.php
  • tests/Global/HasDraggableTest.php
  • tests/Global/HasEventsTest.php
  • tests/Global/HasIdTest.php
  • tests/Global/HasLangTest.php
  • tests/Global/HasMicroDataTest.php
  • tests/Global/HasNonceTest.php
  • tests/Global/HasRoleTest.php
  • tests/Global/HasSpellcheckTest.php
  • tests/Global/HasStyleTest.php
  • tests/Global/HasTabIndexTest.php
  • tests/Global/HasTitleTest.php
  • tests/Global/HasTranslateTest.php
  • tests/HasAsTest.php
  • tests/HasBlockingTest.php
  • tests/HasCharsetTest.php
  • tests/HasContentTest.php
  • tests/HasCrossoriginTest.php
  • tests/HasDownloadTest.php
  • tests/HasFetchpriorityTest.php
  • tests/HasHreflangTest.php
  • tests/HasHttpEquivTest.php
  • tests/HasImagesizesTest.php
  • tests/HasImagesrcsetTest.php
  • tests/HasIntegrityTest.php
  • tests/HasMediaTest.php
  • tests/HasPingTest.php
  • tests/HasReferrerpolicyTest.php
  • tests/HasRelTest.php
  • tests/HasSizesTest.php
  • tests/HasSrcTest.php
  • tests/HasTargetTest.php
  • tests/HasTypeTest.php
  • tests/HasValueTest.php
  • tests/Provider/AsProvider.php
  • tests/Provider/BlockingProvider.php
  • tests/Provider/CharsetProvider.php
  • tests/Provider/ContentProvider.php
  • tests/Provider/CrossoriginProvider.php
  • tests/Provider/DownloadProvider.php
  • tests/Provider/FetchpriorityProvider.php
  • tests/Provider/Global/AccesskeyProvider.php
  • tests/Provider/Global/AriaProvider.php
  • tests/Provider/Global/AutofocusProvider.php
  • tests/Provider/Global/ClassProvider.php
  • tests/Provider/Global/ContentEditableProvider.php
  • tests/Provider/Global/DataProvider.php
  • tests/Provider/Global/DirProvider.php
  • tests/Provider/Global/DraggableProvider.php
  • tests/Provider/Global/EventProvider.php
  • tests/Provider/Global/HiddenProvider.php
  • tests/Provider/Global/IdProvider.php
  • tests/Provider/Global/ItemIdProvider.php
  • tests/Provider/Global/ItemPropProvider.php
  • tests/Provider/Global/ItemRefProvider.php
  • tests/Provider/Global/ItemScopeProvider.php
  • tests/Provider/Global/ItemTypeProvider.php
  • tests/Provider/Global/LangProvider.php
  • tests/Provider/Global/NonceProvider.php
  • tests/Provider/Global/RoleProvider.php
  • tests/Provider/Global/SpellcheckProvider.php
  • tests/Provider/Global/StyleProvider.php
  • tests/Provider/Global/TabIndexProvider.php
  • tests/Provider/Global/TitleProvider.php
  • tests/Provider/Global/TranslateProvider.php
  • tests/Provider/HreflangProvider.php
  • tests/Provider/HttpEquivProvider.php
  • tests/Provider/ImagesizesProvider.php
  • tests/Provider/ImagesrcsetProvider.php
  • tests/Provider/IntegrityProvider.php
  • tests/Provider/MediaProvider.php
  • tests/Provider/PingProvider.php
  • tests/Provider/ReferrerpolicyProvider.php
  • tests/Provider/RelProvider.php
  • tests/Provider/SizesProvider.php
  • tests/Provider/SrcProvider.php
  • tests/Provider/TargetProvider.php
  • tests/Provider/TypeProvider.php
  • tests/Provider/ValueProvider.php
  • tests/Support/Stub/Values/AlertType.php
  • tests/Support/Stub/Values/Backed.php
  • tests/Support/Stub/Values/ButtonSize.php
  • tests/Support/Stub/Values/Priority.php
  • tests/Support/Stub/Values/Status.php
  • tests/Support/Stub/Values/Unit.php
💤 Files with no reviewable changes (6)
  • tests/Support/Stub/Values/ButtonSize.php
  • tests/Support/Stub/Values/Status.php
  • tests/Support/Stub/Values/Backed.php
  • tests/Support/Stub/Values/Unit.php
  • tests/Support/Stub/Values/Priority.php
  • tests/Support/Stub/Values/AlertType.php
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-09T16:05:15.502Z
Learnt from: terabytesoftw
Repo: ui-awesome/html-attribute PR: 18
File: tests/Support/Provider/Global/ContentEditableProvider.php:32-33
Timestamp: 2026-01-09T16:05:15.502Z
Learning: Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories (e.g., from ui-awesome/html-core to ui-awesome/html-attribute). Do not update the header year to the current year; keep the original creation year as stated in the header. This applies to all PHP files throughout the repo that are moved between packages.

Applied to files:

  • tests/Global/HasClassTest.php
  • tests/Global/HasTabIndexTest.php
  • tests/Provider/Global/AutofocusProvider.php
  • src/HasDownload.php
  • src/Global/HasLang.php
  • src/HasCharset.php
  • src/HasAs.php
  • tests/Global/HasDirTest.php
  • tests/Global/HasNonceTest.php
  • tests/Provider/Global/ContentEditableProvider.php
  • tests/Provider/FetchpriorityProvider.php
  • src/Global/HasRole.php
  • tests/HasSizesTest.php
  • src/HasPing.php
  • tests/HasContentTest.php
  • tests/Global/HasAccesskeyTest.php
  • src/HasHttpEquiv.php
  • tests/Global/HasDraggableTest.php
  • tests/HasTypeTest.php
  • tests/HasFetchpriorityTest.php
  • tests/Provider/Global/HiddenProvider.php
  • src/Global/HasMicroData.php
  • src/HasReferrerpolicy.php
  • tests/HasAsTest.php
  • tests/HasReferrerpolicyTest.php
  • tests/Global/HasContentEditableTest.php
  • tests/HasMediaTest.php
  • tests/HasDownloadTest.php
  • tests/Global/HasAriaTest.php
  • tests/HasRelTest.php
  • tests/Global/CanBeAutofocusTest.php
  • tests/HasIntegrityTest.php
  • tests/HasHreflangTest.php
  • tests/Provider/IntegrityProvider.php
  • tests/Provider/Global/TitleProvider.php
  • tests/Provider/Global/DirProvider.php
  • tests/Provider/ValueProvider.php
  • tests/Provider/TypeProvider.php
  • tests/Provider/Global/DataProvider.php
  • tests/Provider/Global/NonceProvider.php
  • tests/HasCrossoriginTest.php
  • tests/Global/HasSpellcheckTest.php
  • tests/Global/HasStyleTest.php
  • tests/Provider/CharsetProvider.php
  • tests/Global/HasRoleTest.php
  • tests/Global/HasTranslateTest.php
  • tests/Global/HasTitleTest.php
  • tests/Provider/Global/ItemIdProvider.php
  • src/Global/HasId.php
  • tests/Provider/Global/TranslateProvider.php
  • tests/Provider/RelProvider.php
  • tests/Provider/Global/ItemScopeProvider.php
  • tests/Provider/CrossoriginProvider.php
  • tests/Provider/ImagesizesProvider.php
  • tests/Global/HasDataTest.php
  • tests/Global/HasLangTest.php
  • tests/HasPingTest.php
  • tests/Provider/ContentProvider.php
  • tests/Provider/Global/LangProvider.php
  • tests/Provider/Global/ClassProvider.php
  • tests/HasImagesrcsetTest.php
  • tests/HasValueTest.php
  • src/Global/HasAccesskey.php
  • tests/Provider/SrcProvider.php
  • tests/Global/CanBeHiddenTest.php
  • tests/Provider/BlockingProvider.php
  • tests/HasTargetTest.php
  • tests/Provider/SizesProvider.php
  • tests/Provider/PingProvider.php
  • tests/Provider/TargetProvider.php
  • tests/Provider/Global/ItemTypeProvider.php
  • tests/HasHttpEquivTest.php
  • tests/Provider/ReferrerpolicyProvider.php
  • tests/HasImagesizesTest.php
  • tests/Provider/HreflangProvider.php
  • tests/Global/HasEventsTest.php
  • tests/HasSrcTest.php
  • tests/Provider/Global/AccesskeyProvider.php
  • tests/Provider/AsProvider.php
  • tests/Global/HasIdTest.php
  • tests/Provider/Global/StyleProvider.php
  • tests/Provider/Global/TabIndexProvider.php
  • tests/Provider/Global/IdProvider.php
  • tests/Provider/DownloadProvider.php
  • src/HasRel.php
  • tests/HasCharsetTest.php
  • tests/Provider/Global/RoleProvider.php
  • tests/Provider/ImagesrcsetProvider.php
  • tests/HasBlockingTest.php
  • tests/Provider/Global/AriaProvider.php
  • tests/Provider/Global/SpellcheckProvider.php
  • tests/Provider/Global/EventProvider.php
  • tests/Provider/Global/ItemRefProvider.php
  • tests/Provider/Global/DraggableProvider.php
  • tests/Provider/MediaProvider.php
  • tests/Global/HasMicroDataTest.php
  • tests/Provider/Global/ItemPropProvider.php
  • tests/Provider/HttpEquivProvider.php
🧬 Code graph analysis (55)
tests/Global/HasClassTest.php (1)
tests/Provider/Global/ClassProvider.php (1)
  • ClassProvider (19-114)
tests/Global/HasTabIndexTest.php (1)
tests/Provider/Global/TabIndexProvider.php (1)
  • TabIndexProvider (15-109)
src/HasDownload.php (1)
src/HasValue.php (1)
  • value (43-46)
src/Global/HasLang.php (1)
src/HasValue.php (1)
  • value (43-46)
src/HasCharset.php (1)
src/HasValue.php (1)
  • value (43-46)
src/HasAs.php (1)
src/HasValue.php (1)
  • value (43-46)
tests/Global/HasNonceTest.php (1)
tests/Provider/Global/NonceProvider.php (1)
  • NonceProvider (19-95)
src/Global/HasRole.php (1)
src/HasValue.php (1)
  • value (43-46)
tests/HasSizesTest.php (1)
tests/Provider/SizesProvider.php (1)
  • SizesProvider (19-102)
src/HasPing.php (1)
src/HasValue.php (1)
  • value (43-46)
tests/HasContentTest.php (1)
tests/Provider/ContentProvider.php (1)
  • ContentProvider (19-102)
tests/Global/HasAccesskeyTest.php (2)
tests/Provider/Global/AccesskeyProvider.php (1)
  • AccesskeyProvider (19-95)
src/Global/HasAccesskey.php (1)
  • accesskey (37-40)
src/HasHttpEquiv.php (1)
src/HasValue.php (1)
  • value (43-46)
tests/Global/HasDraggableTest.php (1)
tests/Provider/Global/DraggableProvider.php (1)
  • DraggableProvider (19-89)
tests/HasTypeTest.php (1)
tests/Provider/TypeProvider.php (1)
  • TypeProvider (20-86)
tests/HasFetchpriorityTest.php (1)
tests/Provider/FetchpriorityProvider.php (1)
  • FetchpriorityProvider (19-68)
src/Global/HasMicroData.php (1)
src/HasValue.php (1)
  • value (43-46)
src/HasReferrerpolicy.php (2)
src/Element/HasReferrerpolicy.php (1)
  • referrerpolicy (47-52)
src/HasValue.php (1)
  • value (43-46)
tests/HasAsTest.php (2)
tests/Provider/AsProvider.php (1)
  • AsProvider (20-86)
src/HasAs.php (1)
  • as (46-51)
tests/HasReferrerpolicyTest.php (1)
src/HasReferrerpolicy.php (1)
  • referrerpolicy (46-51)
tests/Global/HasContentEditableTest.php (1)
tests/Provider/Global/ContentEditableProvider.php (1)
  • ContentEditableProvider (19-89)
tests/HasMediaTest.php (1)
tests/Provider/MediaProvider.php (1)
  • MediaProvider (19-95)
tests/Global/HasAriaTest.php (1)
tests/Provider/Global/AriaProvider.php (1)
  • AriaProvider (20-494)
tests/HasRelTest.php (2)
tests/Provider/RelProvider.php (1)
  • RelProvider (20-86)
src/HasRel.php (1)
  • rel (46-51)
tests/Global/CanBeAutofocusTest.php (1)
tests/Provider/Global/AutofocusProvider.php (1)
  • AutofocusProvider (15-53)
tests/HasIntegrityTest.php (2)
tests/Provider/IntegrityProvider.php (1)
  • IntegrityProvider (19-95)
src/HasIntegrity.php (1)
  • integrity (40-43)
tests/HasCrossoriginTest.php (1)
tests/Provider/CrossoriginProvider.php (1)
  • CrossoriginProvider (19-68)
tests/Global/HasSpellcheckTest.php (1)
tests/Provider/Global/SpellcheckProvider.php (1)
  • SpellcheckProvider (15-81)
tests/Global/HasStyleTest.php (1)
tests/Provider/Global/StyleProvider.php (1)
  • StyleProvider (19-102)
tests/Provider/CharsetProvider.php (1)
src/Global/HasClass.php (1)
  • class (50-61)
tests/Global/HasRoleTest.php (2)
tests/Provider/Global/RoleProvider.php (1)
  • RoleProvider (20-86)
src/Global/HasRole.php (1)
  • role (44-49)
tests/Global/HasTranslateTest.php (1)
tests/Provider/Global/TranslateProvider.php (1)
  • TranslateProvider (19-89)
tests/Global/HasTitleTest.php (1)
tests/Provider/Global/TitleProvider.php (1)
  • TitleProvider (19-95)
src/Global/HasId.php (1)
src/HasValue.php (1)
  • value (43-46)
tests/Provider/RelProvider.php (1)
src/Global/HasClass.php (1)
  • class (50-61)
tests/Global/HasLangTest.php (2)
tests/Provider/Global/LangProvider.php (1)
  • LangProvider (20-86)
src/Global/HasLang.php (1)
  • lang (44-49)
tests/HasPingTest.php (2)
tests/Provider/PingProvider.php (1)
  • PingProvider (19-102)
src/HasPing.php (1)
  • ping (40-43)
tests/Provider/Global/LangProvider.php (1)
src/Global/HasClass.php (1)
  • class (50-61)
tests/HasImagesrcsetTest.php (1)
tests/Provider/ImagesrcsetProvider.php (1)
  • ImagesrcsetProvider (19-102)
tests/HasValueTest.php (2)
tests/Provider/ValueProvider.php (1)
  • ValueProvider (19-116)
src/HasValue.php (1)
  • value (43-46)
src/Global/HasAccesskey.php (1)
src/HasValue.php (1)
  • value (43-46)
tests/Global/CanBeHiddenTest.php (1)
tests/Provider/Global/HiddenProvider.php (1)
  • HiddenProvider (15-53)
tests/HasTargetTest.php (1)
tests/Provider/TargetProvider.php (1)
  • TargetProvider (19-68)
tests/HasHttpEquivTest.php (2)
tests/Provider/HttpEquivProvider.php (1)
  • HttpEquivProvider (20-86)
src/HasHttpEquiv.php (1)
  • httpEquiv (46-51)
tests/Provider/ReferrerpolicyProvider.php (1)
src/Global/HasClass.php (1)
  • class (50-61)
tests/HasImagesizesTest.php (1)
tests/Provider/ImagesizesProvider.php (1)
  • ImagesizesProvider (19-102)
tests/Global/HasEventsTest.php (1)
tests/Provider/Global/EventProvider.php (1)
  • EventProvider (20-376)
tests/HasSrcTest.php (1)
src/HasSrc.php (1)
  • src (40-43)
tests/Provider/AsProvider.php (1)
src/Global/HasClass.php (1)
  • class (50-61)
tests/Global/HasIdTest.php (2)
tests/Provider/Global/IdProvider.php (1)
  • IdProvider (19-95)
src/Global/HasId.php (1)
  • id (37-40)
src/HasRel.php (1)
src/HasValue.php (1)
  • value (43-46)
tests/HasCharsetTest.php (2)
tests/Provider/CharsetProvider.php (1)
  • CharsetProvider (20-86)
src/HasCharset.php (1)
  • charset (46-51)
tests/Provider/Global/RoleProvider.php (1)
src/Global/HasClass.php (1)
  • class (50-61)
tests/Global/HasMicroDataTest.php (1)
src/Global/HasMicroData.php (4)
  • itemId (37-40)
  • itemProp (57-60)
  • itemRef (77-80)
  • itemType (117-120)
tests/Provider/HttpEquivProvider.php (1)
src/Global/HasClass.php (1)
  • class (50-61)
🪛 PHPMD (2.15.0)
src/HasAs.php

[warning] 46-51: Avoid using short method names like HasAs::as(). The configured minimum method name length is 3. (undefined)

(ShortMethodName)

tests/HasAsTest.php

[warning] 70-70: Avoid variables with short names like $as. Configured minimum length is 3. (undefined)

(ShortVariable)

tests/Provider/CharsetProvider.php

[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)

(StaticAccess)

src/Global/HasId.php

[warning] 37-40: Avoid using short method names like HasId::id(). The configured minimum method name length is 3. (undefined)

(ShortMethodName)

tests/Provider/RelProvider.php

[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)

(StaticAccess)

tests/Provider/Global/LangProvider.php

[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)

(StaticAccess)

tests/Provider/ReferrerpolicyProvider.php

[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)

(StaticAccess)

tests/Provider/AsProvider.php

[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)

(StaticAccess)

tests/Global/HasIdTest.php

[warning] 67-67: Avoid variables with short names like $id. Configured minimum length is 3. (undefined)

(ShortVariable)

tests/Provider/Global/RoleProvider.php

[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)

(StaticAccess)

tests/Provider/HttpEquivProvider.php

[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (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). (16)
  • GitHub Check: phpunit / PHP 8.4-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.2-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.1-windows-2022
  • GitHub Check: phpunit / PHP 8.5-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.4-windows-2022
  • GitHub Check: phpunit / PHP 8.2-windows-2022
  • GitHub Check: phpunit / PHP 8.3-windows-2022
  • GitHub Check: phpunit / PHP 8.5-windows-2022
  • GitHub Check: phpunit / PHP 8.3-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.1-ubuntu-latest
  • GitHub Check: linter / Super Linter
  • GitHub Check: phpstan / PHP 8.5-ubuntu-latest
  • GitHub Check: mutation / PHP 8.5-ubuntu-latest
  • GitHub Check: composer-require-checker / PHP 8.5-ubuntu-latest
  • GitHub Check: easy-coding-standard / PHP 8.5-ubuntu-latest
  • GitHub Check: linter / Super Linter
🔇 Additional comments (135)
tests/Provider/FetchpriorityProvider.php (1)

5-5: LGTM!

The namespace relocation from Tests\Support\Provider to Tests\Provider is consistent with the PR objective. The provider logic and data structure remain unchanged.

tests/HasFetchpriorityTest.php (1)

11-11: LGTM!

The import path update correctly references the relocated FetchpriorityProvider under the new Tests\Provider namespace, maintaining consistency with the provider's namespace change.

tests/Provider/Global/DraggableProvider.php (1)

5-5: LGTM!

The namespace relocation from Tests\Support\Provider\Global to Tests\Provider\Global correctly aligns with the PR objective to simplify the test directory structure.

tests/Global/HasDraggableTest.php (1)

11-11: LGTM!

The import statement is correctly updated to reference the provider's new namespace location, maintaining consistency with the relocated DraggableProvider class.

tests/Provider/TypeProvider.php (1)

5-5: LGTM!

The namespace update from UIAwesome\Html\Attribute\Tests\Support\Provider to UIAwesome\Html\Attribute\Tests\Provider correctly reflects the directory relocation described in the PR objectives.

tests/HasTypeTest.php (1)

12-12: LGTM!

The import path correctly updated to reference TypeProvider at its new namespace location, maintaining consistency with the provider's namespace change.

tests/HasSrcTest.php (1)

9-11: LGTM!

The import path update from Tests\Support\Provider\SrcProvider to Tests\Provider\SrcProvider aligns with the PR objective. The type signatures correctly mirror the src() method signature (string|Stringable|UnitEnum|null) from the trait, ensuring test coverage for the broadened type union.

Also applies to: 67-69

tests/Provider/SrcProvider.php (3)

5-8: LGTM!

The namespace relocation to Tests\Provider fulfills the PR objective. Using shared stubs (BackedString, Unit) from PHPForge\Support\Stub instead of local stubs is a good approach that reduces code duplication and improves maintainability.


29-34: LGTM!

The anonymous Stringable implementation provides a clean, self-contained test fixture without requiring an additional stub class.


44-57: LGTM!

Test coverage is comprehensive: enum backed string, unit enum, and Stringable cases properly exercise the widened type union in HasSrc::src(). The expected rendered outputs correctly match the enum/stringable string representations.

Also applies to: 79-85

tests/Provider/MediaProvider.php (2)

5-7: Namespace relocation and external stubs look correct.

The namespace change from Tests\Support\Provider to Tests\Provider aligns with the PR objectives. The import of shared stubs from PHPForge\Support\Stub is appropriate for standardizing test fixtures across projects.


44-57: New enum test cases are well-structured.

The test cases for BackedString::VALUE and Unit::value properly exercise the expanded type support (UnitEnum) in the media attribute setter. The expected output ' media="value"' indicates these enums convert correctly to string values.

[approve_code_changes, request_verification]

Verify that the PHPForge\Support\Stub package is declared as a dev dependency and provides the expected enum stubs:

#!/bin/bash
# Check composer.json for phpforge/support dependency
echo "=== Checking composer.json for phpforge/support dependency ==="
cat composer.json | jq '.["require-dev"]'

# Search for any other usages of BackedString or Unit stubs in the codebase
echo -e "\n=== Other usages of BackedString and Unit stubs ==="
rg -n "BackedString|Unit::" --type php -g '!vendor/*'
tests/HasMediaTest.php (1)

11-11: Import path update is consistent with provider relocation.

The updated import path correctly reflects the MediaProvider relocation from Tests\Support\Provider to Tests\Provider.

tests/Provider/TargetProvider.php (1)

5-5: LGTM!

The namespace relocation from UIAwesome\Html\Attribute\Tests\Support\Provider to UIAwesome\Html\Attribute\Tests\Provider aligns correctly with the PR objectives.

tests/HasTargetTest.php (1)

11-11: LGTM!

The import path update correctly reflects the relocated TargetProvider namespace and maintains consistency with the provider's new location.

tests/Provider/BlockingProvider.php (1)

5-5: Namespace update aligns with provider relocation.
LGTM for the new namespace under Tests\Provider.

tests/HasBlockingTest.php (1)

11-11: Import update is correct for the provider move.
No issues.

tests/HasValueTest.php (2)

9-11: LGTM!

The Stringable import and updated provider namespace correctly reflect the PR's refactoring objectives. The import path change from Tests\Support\Provider\ValueProvider to Tests\Provider\ValueProvider aligns with the directory restructure.


66-72: LGTM!

The expanded type hints (float|int|string|Stringable|UnitEnum|null for input, float|int|string|Stringable|UnitEnum for expected value) correctly match the signature of HasValue::value() in src/HasValue.php and the ValueProvider::values() return type annotation.

tests/Provider/ValueProvider.php (4)

21-25: LGTM!

The PHPStan return annotation accurately documents the array structure with the expanded union types including Stringable and UnitEnum, providing proper static analysis coverage.


29-34: LGTM!

The anonymous class implementing Stringable is a clean pattern for testing the Stringable type support without introducing additional test stub dependencies.


44-57: LGTM!

The new test cases for 'enum backed string' and 'enum unit' properly exercise the UnitEnum type support using shared stubs from PHPForge\Support\Stub, which is preferable to maintaining project-specific enum stubs.


100-106: LGTM!

The 'stringable' test case correctly uses the local anonymous Stringable instance and validates both the stored value (the instance itself) and the rendered output (' value="text-value"').

tests/Provider/SizesProvider.php (3)

5-9: LGTM! Namespace relocation and new imports are properly structured.

The namespace change aligns with the PR objective to move providers from Support\Provider to Provider. The imports for BackedString, Unit, and Stringable correctly support the expanded test coverage.


22-25: PHPStan return type annotation correctly expanded.

The annotation accurately describes the array structure with the union types string|Stringable|UnitEnum|null for input values and string|Stringable|UnitEnum for expected values.


29-34: Test cases for Stringable and UnitEnum types are well-structured.

The anonymous class implementing Stringable is a clean approach for testing the interface. The test cases for BackedString::VALUE, Unit::value, and the Stringable instance properly exercise the widened type support in the sizes attribute setter. The php-forge/support dependency is available in require-dev, providing the necessary BackedString and Unit stubs.

tests/HasSizesTest.php (1)

11-11: Import path correctly updated to match relocated provider.

The import change from Tests\Support\Provider\SizesProvider to Tests\Provider\SizesProvider correctly aligns with the provider relocation. The test method signature and DataProviderExternal reference remain compatible.

tests/Provider/CrossoriginProvider.php (1)

5-5: Namespace relocation looks consistent.

The namespace change matches the new tests\Provider structure and doesn’t alter provider behavior.

tests/Global/HasDataTest.php (1)

15-15: Import update aligns with provider relocation.

No functional impact; the new namespace is consistent with the moved provider.

tests/Global/HasClassTest.php (1)

11-11: Provider import path is correct after relocation.

This change is consistent with the new provider namespace.

tests/Global/HasDirTest.php (1)

11-11: Provider import path matches the new location.

Looks good after the namespace move.

tests/Provider/Global/HiddenProvider.php (1)

5-5: Namespace update is consistent with provider relocation.

No behavioral changes; looks correct.

CHANGELOG.md (1)

47-47: Changelog entry accurately captures the test scaffolding change.

This aligns with the PR’s stated objective.

tests/Global/CanBeHiddenTest.php (1)

10-10: Provider import update looks correct.

Consistent with the new namespace layout.

tests/HasCrossoriginTest.php (1)

11-11: Namespace import update looks consistent.
No issues spotted.

tests/Provider/Global/AutofocusProvider.php (1)

5-13: Confirm header year is preserved after the move.
Since this file was relocated, please verify the copyright year reflects the original creation year and wasn’t updated during the move.

Based on learnings: Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories (e.g., from ui-awesome/html-core to ui-awesome/html-attribute). Do not update the header year to the current year; keep the original creation year as stated in the header. This applies to all PHP files throughout the repo that are moved between packages.

tests/Global/CanBeAutofocusTest.php (1)

10-10: No additional review comment for this change.

tests/Provider/Global/StyleProvider.php (1)

5-63: Verify BackedString::VALUE stringifies to “value” for expected render.
The expected outputs now assert color: value;. Please confirm the PHPForge\Support\Stub\BackedString enum in the dependency version used stringifies to "value"; otherwise these cases will mis-match.

tests/Global/HasStyleTest.php (1)

11-11: No additional review comment for this change.

tests/Provider/Global/TabIndexProvider.php (1)

5-5: No additional review comment for this change.

tests/Global/HasTabIndexTest.php (1)

12-12: No additional review comment for this change.

tests/Provider/ReferrerpolicyProvider.php (2)

5-5: Namespace relocation looks correct.

Matches the Provider namespace move for the test providers.


23-74: The test expectation is correct. The stringable test case properly expects the Stringable object to be stored and retrieved as-is by getAttribute(), with string conversion occurring only during rendering. No adjustment is needed.

tests/Provider/Global/TranslateProvider.php (1)

5-5: Namespace update is consistent with provider relocation.

No functional changes needed.

tests/Global/HasTranslateTest.php (1)

11-11: Import path update looks correct.

Aligns the test with the provider’s new namespace.

tests/Provider/Global/ContentEditableProvider.php (1)

5-5: Namespace update is consistent with provider relocation.

No functional changes needed.

tests/Global/HasContentEditableTest.php (1)

11-11: Import path update looks correct.

Aligns the test with the provider’s new namespace.

src/Global/HasAccesskey.php (1)

7-37: Signature expansion is consistent with the broader Stringable/UnitEnum support.

No additional changes needed here.

src/HasCharset.php (1)

31-50: No changes needed. The code correctly handles Stringable values without normalization. The test case in CharsetProvider at lines 68–74 demonstrates that Validator::oneOf() from the ui-awesome/html-helper package already accepts Stringable instances and validates them properly. The charset() method can pass Stringable directly to the validator without casting.

Likely an incorrect or invalid review comment.

src/HasPing.php (1)

7-7: LGTM!

The addition of Stringable to the ping() method signature is consistent with the pattern used in other attribute setters (e.g., HasValue::value()). The import, docblock, and method signature are properly synchronized.

Also applies to: 29-29, 40-40

src/Global/HasId.php (1)

7-9: LGTM!

The type expansion to include Stringable and UnitEnum is consistent with the project-wide pattern. The PHPMD warning about the short method name id() can be safely ignored—it's the natural name matching the HTML id attribute, and renaming would harm API clarity.

Also applies to: 27-27, 37-40

src/HasDownload.php (1)

7-7: LGTM!

The addition of Stringable to the download() method signature is consistent with other attribute setters. The retention of bool type is appropriate for the download attribute's behavior (using true enables download without specifying a filename).

Also applies to: 29-30, 43-43

src/HasHttpEquiv.php (1)

46-50: Verify that Validator::oneOf() handles Stringable inputs correctly.

Same concern as HasLang: the signature now accepts Stringable, but line 48 passes it directly to Validator::oneOf() which validates against HttpEquiv::cases(). Ensure the validator properly handles Stringable objects when comparing against enum cases.

src/Global/HasRole.php (1)

44-48: Same Validator::oneOf() concern applies here.

As noted for HasLang and HasHttpEquiv, verify that Stringable inputs are properly handled by Validator::oneOf() when validating against Role::cases().

tests/Provider/Global/DirProvider.php (1)

5-5: LGTM!

The namespace relocation from Tests\Support\Provider\Global to Tests\Provider\Global aligns with the PR objective. The original copyright year (2025) is correctly preserved per repository conventions. Based on learnings: "Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories."

Also applies to: 16-16

src/Global/HasLang.php (1)

44-48: No action needed—Validator::oneOf() correctly handles Stringable inputs.

The test suite (LangProvider) includes explicit test coverage for Stringable objects passed to lang(). The validator normalizes inputs before validation, so Stringable objects that represent valid language codes are validated correctly.

src/HasReferrerpolicy.php (1)

31-48: Verify Stringable inputs pass validation.

The method now accepts Stringable, but validation still calls Validator::oneOf with the raw value. If Validator::oneOf doesn’t coerce Stringable to string, valid inputs will be rejected. Please confirm support or normalize before validation.

Proposed normalization (if needed)
-        Validator::oneOf($value, Referrerpolicy::cases(), Attribute::REFERRERPOLICY);
+        $normalized = $value instanceof Stringable ? (string) $value : $value;
+        Validator::oneOf($normalized, Referrerpolicy::cases(), Attribute::REFERRERPOLICY);

-        return $this->addAttribute(Attribute::REFERRERPOLICY, $value);
+        return $this->addAttribute(Attribute::REFERRERPOLICY, $value);
tests/Provider/Global/NonceProvider.php (1)

5-56: LGTM. Namespace update and added cases look consistent with the provider move and expanded test coverage.

tests/Global/HasNonceTest.php (1)

11-11: LGTM. Import change matches the provider namespace move.

tests/Provider/ContentProvider.php (1)

5-92: LGTM. Provider data changes are consistent with the refactor and expanded input coverage.

tests/HasContentTest.php (1)

11-11: LGTM. Import update is aligned with the provider relocation.

tests/Provider/Global/TitleProvider.php (1)

5-56: LGTM. Provider relocation and new cases look consistent.

tests/Global/HasTitleTest.php (1)

11-11: LGTM!

The import path update correctly reflects the relocation of TitleProvider from Tests\Support\Provider\Global to Tests\Provider\Global, consistent with the PR's directory restructuring.

src/HasAs.php (1)

8-8: LGTM!

The type expansion to include Stringable is consistent with the pattern used across other attribute setters in this codebase (e.g., HasValue::value()). The validation via Validator::oneOf will appropriately handle the stringified value.

Also applies to: 31-31, 46-46

tests/Provider/Global/RoleProvider.php (1)

5-5: LGTM!

The namespace relocation, Stringable type expansion, and new test case are well-implemented. The copyright year (2025) is correctly preserved per the repository's convention for moved files. Based on learnings: "Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories."

Also applies to: 8-8, 17-17, 23-26, 32-37, 68-74

tests/Provider/RelProvider.php (1)

5-5: LGTM!

The namespace relocation and Stringable support additions follow the same consistent pattern as other providers. The copyright year (2025) is correctly preserved for this relocated file.

Also applies to: 8-8, 17-17, 23-26, 32-37, 68-74

tests/Provider/Global/AccesskeyProvider.php (1)

5-9: LGTM!

The provider is well-structured with comprehensive test cases covering string, Stringable, backed enums (BackedString::VALUE), and unit enums (Unit::value). Using shared stubs from PHPForge\Support\Stub promotes consistency across the test suite.

Also applies to: 22-25, 29-57, 79-85

src/Global/HasMicroData.php (1)

7-9: LGTM!

The type expansions for microdata attributes (itemId, itemProp, itemRef, itemType) are consistent with the codebase pattern seen in HasValue::value(). Correctly, itemScope() remains bool|null since it's a boolean attribute that doesn't benefit from Stringable/UnitEnum support.

Also applies to: 25-25, 37-37, 45-45, 57-57, 65-65, 77-77, 105-105, 117-117

tests/Provider/IntegrityProvider.php (1)

5-9: LGTM!

The provider comprehensively covers all supported value types for the integrity attribute. The Stringable test case appropriately uses a realistic SHA384 hash value, and the enum cases verify proper handling of BackedString and Unit enum types.

Also applies to: 22-25, 29-57, 79-85

tests/HasIntegrityTest.php (2)

9-12: LGTM!

The import additions and namespace update align correctly with the PR objective to relocate providers to tests\Provider. The Stringable import supports the expanded type unions in the test method.


67-69: LGTM!

The expanded type unions (string|Stringable|UnitEnum|null and string|Stringable|UnitEnum) correctly mirror the HasIntegrity::integrity() method signature from src/HasIntegrity.php, ensuring full test coverage of accepted input types.

tests/Provider/HttpEquivProvider.php (3)

5-10: LGTM!

The namespace relocation to UIAwesome\Html\Attribute\Tests\Provider and the Stringable import correctly support the PR objective and expanded type coverage.


22-26: LGTM!

The PHPStan return type annotation correctly reflects the expanded tuple structure supporting Stringable in both the input value and expected value positions.


32-74: LGTM!

The anonymous Stringable implementation and corresponding test case follow the established pattern for other test cases. This ensures the http-equiv attribute handling is tested with Stringable inputs.

tests/HasRelTest.php (2)

10-12: LGTM!

The Stringable import and provider namespace update correctly align with the PR restructuring objective and the HasRel::rel() method signature.


70-72: LGTM!

The expanded type unions match the HasRel::rel() signature (string|Stringable|UnitEnum|null), ensuring the test properly validates all accepted input types.

tests/Provider/AsProvider.php (3)

5-10: LGTM!

The namespace relocation and Stringable import correctly support the PR objective and expanded type coverage for the as attribute.


22-37: LGTM!

The expanded PHPStan return type and anonymous Stringable implementation follow the established pattern across the test suite.


68-74: LGTM!

The 'stringable' test case correctly validates that Stringable instances are accepted and rendered properly for the as attribute.

tests/HasAsTest.php (2)

10-12: LGTM!

The Stringable import and provider namespace update correctly align with the PR restructuring objective and the HasAs::as() method signature.


70-72: LGTM!

The expanded type unions match the HasAs::as() signature (string|Stringable|UnitEnum|null), ensuring the test properly validates all accepted input types. The variable name $as is appropriately descriptive as it represents the HTML as attribute.

tests/Provider/HreflangProvider.php (4)

5-9: LGTM!

The namespace relocation and imports correctly support the PR objective. Using shared stubs (BackedString, Unit) from PHPForge\Support\Stub aligns with the PR's goal of replacing project-specific test stubs.


22-34: LGTM!

The expanded PHPStan return type and anonymous Stringable implementation follow the established pattern across the test suite for the hreflang attribute.


44-57: LGTM!

The new test cases using BackedString::VALUE and Unit::value from the shared PHPForge\Support\Stub namespace correctly exercise enum-backed attribute handling.


79-85: LGTM!

The 'stringable' test case correctly validates that Stringable instances are accepted and rendered properly for the hreflang attribute.

tests/HasHreflangTest.php (1)

11-11: LGTM!

The provider namespace update correctly aligns with the PR objective to relocate providers to tests\Provider.

tests/Provider/DownloadProvider.php (1)

1-108: LGTM!

The namespace relocation, expanded type annotations, and new test cases for Stringable and UnitEnum are well-structured and consistent with the PR objectives. The anonymous Stringable implementation is appropriate for testing purposes.

tests/HasDownloadTest.php (2)

9-15: LGTM!

The imports for Stringable and UnitEnum are correctly added, and the provider import path is updated to reflect the new namespace structure.


65-90: LGTM!

The test method signature correctly reflects the expanded type union (bool|string|Stringable|UnitEnum|null) consistent with both the DownloadProvider data types and the production HasDownload::download() method signature.

tests/Provider/PingProvider.php (1)

1-101: LGTM!

The provider is well-structured with consistent namespace relocation, proper imports, and comprehensive test cases for Stringable and UnitEnum types. The anonymous Stringable implementation correctly returns a valid ping URL.

tests/HasReferrerpolicyTest.php (2)

10-12: LGTM!

The Stringable import is correctly added, and the provider import path is updated to reflect the new namespace structure.


68-93: LGTM!

The test method signature correctly reflects the expanded type union (string|Stringable|UnitEnum|null) consistent with the production HasReferrerpolicy::referrerpolicy() method signature shown in the relevant code snippet.

tests/HasPingTest.php (2)

9-15: LGTM!

The imports for Stringable and UnitEnum are correctly added, and the provider import path is updated to reflect the new namespace structure.


65-90: LGTM!

The test method signature correctly reflects the expanded type union (string|Stringable|UnitEnum|null) consistent with the production HasPing::ping() method signature.

tests/HasHttpEquivTest.php (2)

10-12: LGTM!

The Stringable import is correctly added, and the provider import path is updated to reflect the new namespace structure.


68-93: LGTM!

The test method signature correctly reflects the expanded type union (string|Stringable|UnitEnum|null) consistent with the production HasHttpEquiv::httpEquiv() method signature.

tests/Provider/ImagesizesProvider.php (1)

1-101: LGTM!

The provider is well-structured with consistent namespace relocation, proper imports, and comprehensive test cases for Stringable and UnitEnum types. The anonymous Stringable implementation correctly returns a valid imagesizes value (100vw).

tests/HasImagesizesTest.php (1)

11-11: Provider namespace update looks correct.
Aligns the test with the moved provider location.

tests/Global/HasAriaTest.php (1)

15-15: Provider namespace update is consistent with the refactor.
No further changes needed.

tests/Global/HasEventsTest.php (1)

15-15: Provider namespace update matches new test provider location.

tests/Global/HasSpellcheckTest.php (1)

11-11: Provider namespace update looks correct.

tests/Provider/Global/ItemScopeProvider.php (1)

5-5: Namespace relocation is consistent with the new provider layout.

tests/HasImagesrcsetTest.php (1)

11-11: Provider namespace update aligns with the new directory structure.

tests/Provider/CharsetProvider.php (1)

5-8: Stringable coverage and phpstan typing updates look good.
The new fixture and case align with the expanded union types.

Also applies to: 23-37, 68-74

tests/Provider/Global/SpellcheckProvider.php (1)

5-5: Namespace relocation looks consistent. The provider namespace matches the new Tests\Provider\Global layout and aligns with the test suite move.

tests/Global/HasIdTest.php (1)

67-70: Type unions now align with the HasId API and provider data. This keeps the test signature consistent with the widened attribute value types.

tests/Global/HasLangTest.php (1)

70-73: Test signature now matches the expanded lang value types. This stays aligned with the updated provider and trait API.

tests/Provider/Global/LangProvider.php (1)

5-8: Provider updates correctly mirror the new type coverage and namespace move. Stringable cases and phpdoc unions match the broader test strategy.

Also applies to: 23-26, 32-74

tests/Global/HasAccesskeyTest.php (1)

67-70: Type unions now match the widened accesskey API. This keeps the test aligned with provider inputs and expected outputs.

tests/Provider/Global/ItemRefProvider.php (1)

5-10: Provider data and typing updates look consistent with the expanded value support. The new enum and Stringable cases are well integrated.

Also applies to: 22-25, 29-85

tests/Provider/Global/EventProvider.php (1)

5-8: Stub replacement and expected values are consistent across event cases. The BackedInteger-based updates align with the new shared stubs.

Also applies to: 54-131, 217-261

tests/Provider/Global/ClassProvider.php (2)

5-7: LGTM!

The namespace relocation and import update are correctly implemented. The switch from the project-specific AlertType enum to the shared PHPForge\Support\Stub\BackedString aligns with the PR's objective to use common test stubs.


45-49: LGTM!

The enum test case correctly uses BackedString::VALUE which produces 'value', matching the expected attribute output ' class="value"'.

tests/Provider/Global/ItemTypeProvider.php (2)

5-9: LGTM!

Namespace relocation and new imports for BackedString, Unit, Stringable, and UnitEnum are correctly implemented to support expanded type coverage.


29-34: LGTM!

The new test cases for Stringable and UnitEnum types are well-structured:

  • The anonymous Stringable class produces a realistic schema.org URL
  • Both backed and unit enum cases correctly expect ' itemtype="value"'
  • The stringable case properly expects ' itemtype="http://schema.org/Book"'

Also applies to: 44-57, 79-85

tests/Provider/ImagesrcsetProvider.php (2)

5-9: LGTM!

Namespace relocation from Tests\Support\Provider to Tests\Provider is correctly implemented with proper imports for the expanded type support.


29-34: LGTM!

The Stringable fixture and new enum test cases are well-implemented. The anonymous class returns a realistic imagesrcset value ('image-400.jpg 400w'), and all expected outputs correctly match the input types.

Also applies to: 44-57, 86-92

tests/Provider/Global/AriaProvider.php (3)

5-10: LGTM!

Namespace relocation and BackedInteger import correctly support testing integer-backed enum values for aria attributes.


53-56: LGTM!

The BackedInteger::VALUE usage is correct:

  • In invalidSingleKey: Tests that an enum cannot be used as an aria attribute key
  • In renderAttribute: Correctly expects ' aria-size="1"' since BackedInteger::VALUE has backing value 1
  • Consistent application across closure and direct enum value test cases

Also applies to: 103-106, 138-142


257-262: LGTM!

The value() and values() methods consistently use BackedInteger::VALUE for enum test cases, with correct expected results storing the enum instance in the attributes array.

Also applies to: 299-304, 408-443

tests/HasCharsetTest.php (2)

10-12: LGTM!

The Stringable import and updated provider namespace path correctly align with the relocated provider structure.


69-75: LGTM!

The expanded parameter types string|Stringable|UnitEnum|null for $charset and string|Stringable|UnitEnum for $expectedValue correctly match the CharsetProvider::values() return type and the HasCharset::charset() method signature shown in the relevant code snippet.

tests/Provider/Global/ItemIdProvider.php (2)

5-9: LGTM!

Namespace relocation and imports correctly support the expanded Stringable and UnitEnum type coverage.


29-34: LGTM!

The test data expansion is well-implemented:

  • The Stringable fixture returns 'id-one', matching the existing string test case value
  • Both enum cases correctly expect ' itemid="value"'
  • Copyright year 2025 is correctly preserved per repository guidelines

Based on learnings: "Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories."

Also applies to: 44-57, 79-85

tests/Provider/Global/IdProvider.php (2)

5-9: LGTM!

Namespace relocation and imports correctly implemented for expanded type support.


29-34: LGTM!

The test data expansion follows the same pattern as other providers:

  • Stringable fixture returns 'id-one' for consistency with the string test case
  • Enum cases correctly expect ' id="value"'
  • Copyright year 2025 is correctly preserved per repository guidelines

Based on learnings: "Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories."

Also applies to: 44-57, 79-85

tests/Global/HasRoleTest.php (2)

10-12: LGTM.


69-72: LGTM.

tests/Provider/Global/DataProvider.php (2)

5-8: LGTM.


54-55: Backing value for BackedInteger::VALUE should match the hardcoded "1" expectations in assertions.

The php-forge/support dependency is already present in require-dev. However, verify that BackedInteger::VALUE from phpforge/support ^0.3 actually has a backing value of 1, as multiple test assertions at lines 54–55, 103–106, 139–142, 258–261, 301–303, 404–406, and 434–436 depend on this.

tests/Provider/Global/ItemPropProvider.php (3)

5-9: LGTM.


22-34: LGTM.

Also applies to: 79-85


44-57: Verify BackedString/Unit stub values match expected render output.

These cases expect "value" in rendered output; if the stubs back a different value or use a different case name, the assertions will fail.

Note: The BackedString and Unit enums are imported from the external package php-forge/support (version ^0.3, in require-dev). While the actual enum definitions could not be directly accessed, the consistent test patterns across the entire test suite—where these enums are paired with expected rendered output containing "value" in dozens of test providers—strongly suggest the stubs correctly back this value. However, direct verification of the php-forge/support package source would be needed for definitive confirmation.

tests/Global/HasMicroDataTest.php (2)

9-21: LGTM.

Also applies to: 33-34


129-133: LGTM.

Also applies to: 160-163, 190-193, 250-253

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread tests/Provider/ValueProvider.php
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