fix(tests): Remove directory tests\Stub and move tests\Support\Provider to tests\Provider in tests.#74
Conversation
…vider` to `tests\Provider` in tests.
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughThis PR expands attribute setter method parameter types across multiple trait classes to accept Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 | 🟡 MinorVerify the copyright year wasn’t updated during the move.
If this file was moved fromtests/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
📒 Files selected for processing (105)
CHANGELOG.mdsrc/Global/HasAccesskey.phpsrc/Global/HasId.phpsrc/Global/HasLang.phpsrc/Global/HasMicroData.phpsrc/Global/HasRole.phpsrc/HasAs.phpsrc/HasCharset.phpsrc/HasDownload.phpsrc/HasHttpEquiv.phpsrc/HasPing.phpsrc/HasReferrerpolicy.phpsrc/HasRel.phptests/Global/CanBeAutofocusTest.phptests/Global/CanBeHiddenTest.phptests/Global/HasAccesskeyTest.phptests/Global/HasAriaTest.phptests/Global/HasClassTest.phptests/Global/HasContentEditableTest.phptests/Global/HasDataTest.phptests/Global/HasDirTest.phptests/Global/HasDraggableTest.phptests/Global/HasEventsTest.phptests/Global/HasIdTest.phptests/Global/HasLangTest.phptests/Global/HasMicroDataTest.phptests/Global/HasNonceTest.phptests/Global/HasRoleTest.phptests/Global/HasSpellcheckTest.phptests/Global/HasStyleTest.phptests/Global/HasTabIndexTest.phptests/Global/HasTitleTest.phptests/Global/HasTranslateTest.phptests/HasAsTest.phptests/HasBlockingTest.phptests/HasCharsetTest.phptests/HasContentTest.phptests/HasCrossoriginTest.phptests/HasDownloadTest.phptests/HasFetchpriorityTest.phptests/HasHreflangTest.phptests/HasHttpEquivTest.phptests/HasImagesizesTest.phptests/HasImagesrcsetTest.phptests/HasIntegrityTest.phptests/HasMediaTest.phptests/HasPingTest.phptests/HasReferrerpolicyTest.phptests/HasRelTest.phptests/HasSizesTest.phptests/HasSrcTest.phptests/HasTargetTest.phptests/HasTypeTest.phptests/HasValueTest.phptests/Provider/AsProvider.phptests/Provider/BlockingProvider.phptests/Provider/CharsetProvider.phptests/Provider/ContentProvider.phptests/Provider/CrossoriginProvider.phptests/Provider/DownloadProvider.phptests/Provider/FetchpriorityProvider.phptests/Provider/Global/AccesskeyProvider.phptests/Provider/Global/AriaProvider.phptests/Provider/Global/AutofocusProvider.phptests/Provider/Global/ClassProvider.phptests/Provider/Global/ContentEditableProvider.phptests/Provider/Global/DataProvider.phptests/Provider/Global/DirProvider.phptests/Provider/Global/DraggableProvider.phptests/Provider/Global/EventProvider.phptests/Provider/Global/HiddenProvider.phptests/Provider/Global/IdProvider.phptests/Provider/Global/ItemIdProvider.phptests/Provider/Global/ItemPropProvider.phptests/Provider/Global/ItemRefProvider.phptests/Provider/Global/ItemScopeProvider.phptests/Provider/Global/ItemTypeProvider.phptests/Provider/Global/LangProvider.phptests/Provider/Global/NonceProvider.phptests/Provider/Global/RoleProvider.phptests/Provider/Global/SpellcheckProvider.phptests/Provider/Global/StyleProvider.phptests/Provider/Global/TabIndexProvider.phptests/Provider/Global/TitleProvider.phptests/Provider/Global/TranslateProvider.phptests/Provider/HreflangProvider.phptests/Provider/HttpEquivProvider.phptests/Provider/ImagesizesProvider.phptests/Provider/ImagesrcsetProvider.phptests/Provider/IntegrityProvider.phptests/Provider/MediaProvider.phptests/Provider/PingProvider.phptests/Provider/ReferrerpolicyProvider.phptests/Provider/RelProvider.phptests/Provider/SizesProvider.phptests/Provider/SrcProvider.phptests/Provider/TargetProvider.phptests/Provider/TypeProvider.phptests/Provider/ValueProvider.phptests/Support/Stub/Values/AlertType.phptests/Support/Stub/Values/Backed.phptests/Support/Stub/Values/ButtonSize.phptests/Support/Stub/Values/Priority.phptests/Support/Stub/Values/Status.phptests/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.phptests/Global/HasTabIndexTest.phptests/Provider/Global/AutofocusProvider.phpsrc/HasDownload.phpsrc/Global/HasLang.phpsrc/HasCharset.phpsrc/HasAs.phptests/Global/HasDirTest.phptests/Global/HasNonceTest.phptests/Provider/Global/ContentEditableProvider.phptests/Provider/FetchpriorityProvider.phpsrc/Global/HasRole.phptests/HasSizesTest.phpsrc/HasPing.phptests/HasContentTest.phptests/Global/HasAccesskeyTest.phpsrc/HasHttpEquiv.phptests/Global/HasDraggableTest.phptests/HasTypeTest.phptests/HasFetchpriorityTest.phptests/Provider/Global/HiddenProvider.phpsrc/Global/HasMicroData.phpsrc/HasReferrerpolicy.phptests/HasAsTest.phptests/HasReferrerpolicyTest.phptests/Global/HasContentEditableTest.phptests/HasMediaTest.phptests/HasDownloadTest.phptests/Global/HasAriaTest.phptests/HasRelTest.phptests/Global/CanBeAutofocusTest.phptests/HasIntegrityTest.phptests/HasHreflangTest.phptests/Provider/IntegrityProvider.phptests/Provider/Global/TitleProvider.phptests/Provider/Global/DirProvider.phptests/Provider/ValueProvider.phptests/Provider/TypeProvider.phptests/Provider/Global/DataProvider.phptests/Provider/Global/NonceProvider.phptests/HasCrossoriginTest.phptests/Global/HasSpellcheckTest.phptests/Global/HasStyleTest.phptests/Provider/CharsetProvider.phptests/Global/HasRoleTest.phptests/Global/HasTranslateTest.phptests/Global/HasTitleTest.phptests/Provider/Global/ItemIdProvider.phpsrc/Global/HasId.phptests/Provider/Global/TranslateProvider.phptests/Provider/RelProvider.phptests/Provider/Global/ItemScopeProvider.phptests/Provider/CrossoriginProvider.phptests/Provider/ImagesizesProvider.phptests/Global/HasDataTest.phptests/Global/HasLangTest.phptests/HasPingTest.phptests/Provider/ContentProvider.phptests/Provider/Global/LangProvider.phptests/Provider/Global/ClassProvider.phptests/HasImagesrcsetTest.phptests/HasValueTest.phpsrc/Global/HasAccesskey.phptests/Provider/SrcProvider.phptests/Global/CanBeHiddenTest.phptests/Provider/BlockingProvider.phptests/HasTargetTest.phptests/Provider/SizesProvider.phptests/Provider/PingProvider.phptests/Provider/TargetProvider.phptests/Provider/Global/ItemTypeProvider.phptests/HasHttpEquivTest.phptests/Provider/ReferrerpolicyProvider.phptests/HasImagesizesTest.phptests/Provider/HreflangProvider.phptests/Global/HasEventsTest.phptests/HasSrcTest.phptests/Provider/Global/AccesskeyProvider.phptests/Provider/AsProvider.phptests/Global/HasIdTest.phptests/Provider/Global/StyleProvider.phptests/Provider/Global/TabIndexProvider.phptests/Provider/Global/IdProvider.phptests/Provider/DownloadProvider.phpsrc/HasRel.phptests/HasCharsetTest.phptests/Provider/Global/RoleProvider.phptests/Provider/ImagesrcsetProvider.phptests/HasBlockingTest.phptests/Provider/Global/AriaProvider.phptests/Provider/Global/SpellcheckProvider.phptests/Provider/Global/EventProvider.phptests/Provider/Global/ItemRefProvider.phptests/Provider/Global/DraggableProvider.phptests/Provider/MediaProvider.phptests/Global/HasMicroDataTest.phptests/Provider/Global/ItemPropProvider.phptests/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\ProvidertoTests\Provideris 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
FetchpriorityProviderunder the newTests\Providernamespace, maintaining consistency with the provider's namespace change.tests/Provider/Global/DraggableProvider.php (1)
5-5: LGTM!The namespace relocation from
Tests\Support\Provider\GlobaltoTests\Provider\Globalcorrectly 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
DraggableProviderclass.tests/Provider/TypeProvider.php (1)
5-5: LGTM!The namespace update from
UIAwesome\Html\Attribute\Tests\Support\ProvidertoUIAwesome\Html\Attribute\Tests\Providercorrectly reflects the directory relocation described in the PR objectives.tests/HasTypeTest.php (1)
12-12: LGTM!The import path correctly updated to reference
TypeProviderat 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\SrcProvidertoTests\Provider\SrcProvideraligns with the PR objective. The type signatures correctly mirror thesrc()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\Providerfulfills the PR objective. Using shared stubs (BackedString,Unit) fromPHPForge\Support\Stubinstead of local stubs is a good approach that reduces code duplication and improves maintainability.
29-34: LGTM!The anonymous
Stringableimplementation 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
Stringablecases properly exercise the widened type union inHasSrc::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\ProvidertoTests\Provideraligns with the PR objectives. The import of shared stubs fromPHPForge\Support\Stubis appropriate for standardizing test fixtures across projects.
44-57: New enum test cases are well-structured.The test cases for
BackedString::VALUEandUnit::valueproperly exercise the expanded type support (UnitEnum) in themediaattribute setter. The expected output' media="value"'indicates these enums convert correctly to string values.[approve_code_changes, request_verification]
Verify that the
PHPForge\Support\Stubpackage 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
MediaProviderrelocation fromTests\Support\ProvidertoTests\Provider.tests/Provider/TargetProvider.php (1)
5-5: LGTM!The namespace relocation from
UIAwesome\Html\Attribute\Tests\Support\ProvidertoUIAwesome\Html\Attribute\Tests\Provideraligns correctly with the PR objectives.tests/HasTargetTest.php (1)
11-11: LGTM!The import path update correctly reflects the relocated
TargetProvidernamespace 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 underTests\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
Stringableimport and updated provider namespace correctly reflect the PR's refactoring objectives. The import path change fromTests\Support\Provider\ValueProvidertoTests\Provider\ValueProvideraligns with the directory restructure.
66-72: LGTM!The expanded type hints (
float|int|string|Stringable|UnitEnum|nullfor input,float|int|string|Stringable|UnitEnumfor expected value) correctly match the signature ofHasValue::value()insrc/HasValue.phpand theValueProvider::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
StringableandUnitEnum, providing proper static analysis coverage.
29-34: LGTM!The anonymous class implementing
Stringableis a clean pattern for testing theStringabletype support without introducing additional test stub dependencies.
44-57: LGTM!The new test cases for 'enum backed string' and 'enum unit' properly exercise the
UnitEnumtype support using shared stubs fromPHPForge\Support\Stub, which is preferable to maintaining project-specific enum stubs.
100-106: LGTM!The 'stringable' test case correctly uses the local anonymous
Stringableinstance 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\ProvidertoProvider. The imports forBackedString,Unit, andStringablecorrectly 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|nullfor input values andstring|Stringable|UnitEnumfor expected values.
29-34: Test cases forStringableandUnitEnumtypes are well-structured.The anonymous class implementing
Stringableis a clean approach for testing the interface. The test cases forBackedString::VALUE,Unit::value, and theStringableinstance properly exercise the widened type support in thesizesattribute setter. Thephp-forge/supportdependency is available inrequire-dev, providing the necessaryBackedStringandUnitstubs.tests/HasSizesTest.php (1)
11-11: Import path correctly updated to match relocated provider.The import change from
Tests\Support\Provider\SizesProvidertoTests\Provider\SizesProvidercorrectly aligns with the provider relocation. The test method signature andDataProviderExternalreference remain compatible.tests/Provider/CrossoriginProvider.php (1)
5-5: Namespace relocation looks consistent.The namespace change matches the new
tests\Providerstructure 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 assertcolor: value;. Please confirm thePHPForge\Support\Stub\BackedStringenum 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. Thestringabletest case properly expects the Stringable object to be stored and retrieved as-is bygetAttribute(), 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 handlesStringablevalues without normalization. The test case inCharsetProviderat lines 68–74 demonstrates thatValidator::oneOf()from theui-awesome/html-helperpackage already acceptsStringableinstances and validates them properly. Thecharset()method can passStringabledirectly to the validator without casting.Likely an incorrect or invalid review comment.
src/HasPing.php (1)
7-7: LGTM!The addition of
Stringableto theping()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
StringableandUnitEnumis consistent with the project-wide pattern. The PHPMD warning about the short method nameid()can be safely ignored—it's the natural name matching the HTMLidattribute, and renaming would harm API clarity.Also applies to: 27-27, 37-40
src/HasDownload.php (1)
7-7: LGTM!The addition of
Stringableto thedownload()method signature is consistent with other attribute setters. The retention ofbooltype is appropriate for the download attribute's behavior (usingtrueenables download without specifying a filename).Also applies to: 29-30, 43-43
src/HasHttpEquiv.php (1)
46-50: Verify thatValidator::oneOf()handlesStringableinputs correctly.Same concern as
HasLang: the signature now acceptsStringable, but line 48 passes it directly toValidator::oneOf()which validates againstHttpEquiv::cases(). Ensure the validator properly handlesStringableobjects when comparing against enum cases.src/Global/HasRole.php (1)
44-48: SameValidator::oneOf()concern applies here.As noted for
HasLangandHasHttpEquiv, verify thatStringableinputs are properly handled byValidator::oneOf()when validating againstRole::cases().tests/Provider/Global/DirProvider.php (1)
5-5: LGTM!The namespace relocation from
Tests\Support\Provider\GlobaltoTests\Provider\Globalaligns 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 handlesStringableinputs.The test suite (LangProvider) includes explicit test coverage for
Stringableobjects passed tolang(). The validator normalizes inputs before validation, soStringableobjects 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 callsValidator::oneOfwith the raw value. IfValidator::oneOfdoesn’t coerceStringableto 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
TitleProviderfromTests\Support\Provider\GlobaltoTests\Provider\Global, consistent with the PR's directory restructuring.src/HasAs.php (1)
8-8: LGTM!The type expansion to include
Stringableis consistent with the pattern used across other attribute setters in this codebase (e.g.,HasValue::value()). The validation viaValidator::oneOfwill appropriately handle the stringified value.Also applies to: 31-31, 46-46
tests/Provider/Global/RoleProvider.php (1)
5-5: LGTM!The namespace relocation,
Stringabletype 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
Stringablesupport 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 fromPHPForge\Support\Stubpromotes 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 inHasValue::value(). Correctly,itemScope()remainsbool|nullsince it's a boolean attribute that doesn't benefit fromStringable/UnitEnumsupport.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
integrityattribute. TheStringabletest case appropriately uses a realistic SHA384 hash value, and the enum cases verify proper handling ofBackedStringandUnitenum 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. TheStringableimport supports the expanded type unions in the test method.
67-69: LGTM!The expanded type unions (
string|Stringable|UnitEnum|nullandstring|Stringable|UnitEnum) correctly mirror theHasIntegrity::integrity()method signature fromsrc/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\Providerand theStringableimport correctly support the PR objective and expanded type coverage.
22-26: LGTM!The PHPStan return type annotation correctly reflects the expanded tuple structure supporting
Stringablein both the input value and expected value positions.
32-74: LGTM!The anonymous
Stringableimplementation and corresponding test case follow the established pattern for other test cases. This ensures thehttp-equivattribute handling is tested withStringableinputs.tests/HasRelTest.php (2)
10-12: LGTM!The
Stringableimport and provider namespace update correctly align with the PR restructuring objective and theHasRel::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
Stringableimport correctly support the PR objective and expanded type coverage for theasattribute.
22-37: LGTM!The expanded PHPStan return type and anonymous
Stringableimplementation follow the established pattern across the test suite.
68-74: LGTM!The 'stringable' test case correctly validates that
Stringableinstances are accepted and rendered properly for theasattribute.tests/HasAsTest.php (2)
10-12: LGTM!The
Stringableimport and provider namespace update correctly align with the PR restructuring objective and theHasAs::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$asis appropriately descriptive as it represents the HTMLasattribute.tests/Provider/HreflangProvider.php (4)
5-9: LGTM!The namespace relocation and imports correctly support the PR objective. Using shared stubs (
BackedString,Unit) fromPHPForge\Support\Stubaligns with the PR's goal of replacing project-specific test stubs.
22-34: LGTM!The expanded PHPStan return type and anonymous
Stringableimplementation follow the established pattern across the test suite for thehreflangattribute.
44-57: LGTM!The new test cases using
BackedString::VALUEandUnit::valuefrom the sharedPHPForge\Support\Stubnamespace correctly exercise enum-backed attribute handling.
79-85: LGTM!The 'stringable' test case correctly validates that
Stringableinstances are accepted and rendered properly for thehreflangattribute.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
StringableandUnitEnumare well-structured and consistent with the PR objectives. The anonymousStringableimplementation is appropriate for testing purposes.tests/HasDownloadTest.php (2)
9-15: LGTM!The imports for
StringableandUnitEnumare 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 theDownloadProviderdata types and the productionHasDownload::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
StringableandUnitEnumtypes. The anonymousStringableimplementation correctly returns a valid ping URL.tests/HasReferrerpolicyTest.php (2)
10-12: LGTM!The
Stringableimport 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 productionHasReferrerpolicy::referrerpolicy()method signature shown in the relevant code snippet.tests/HasPingTest.php (2)
9-15: LGTM!The imports for
StringableandUnitEnumare 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 productionHasPing::ping()method signature.tests/HasHttpEquivTest.php (2)
10-12: LGTM!The
Stringableimport 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 productionHasHttpEquiv::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
StringableandUnitEnumtypes. The anonymousStringableimplementation correctly returns a validimagesizesvalue (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 newTests\Provider\Globallayout 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 expandedlangvalue 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
AlertTypeenum to the sharedPHPForge\Support\Stub\BackedStringaligns with the PR's objective to use common test stubs.
45-49: LGTM!The enum test case correctly uses
BackedString::VALUEwhich 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, andUnitEnumare correctly implemented to support expanded type coverage.
29-34: LGTM!The new test cases for
StringableandUnitEnumtypes are well-structured:
- The anonymous
Stringableclass produces a realistic schema.org URL- Both backed and unit enum cases correctly expect
' itemtype="value"'- The
stringablecase 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\ProvidertoTests\Provideris correctly implemented with proper imports for the expanded type support.
29-34: LGTM!The
Stringablefixture and new enum test cases are well-implemented. The anonymous class returns a realisticimagesrcsetvalue ('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
BackedIntegerimport correctly support testing integer-backed enum values for aria attributes.
53-56: LGTM!The
BackedInteger::VALUEusage is correct:
- In
invalidSingleKey: Tests that an enum cannot be used as an aria attribute key- In
renderAttribute: Correctly expects' aria-size="1"'sinceBackedInteger::VALUEhas backing value1- Consistent application across closure and direct enum value test cases
Also applies to: 103-106, 138-142
257-262: LGTM!The
value()andvalues()methods consistently useBackedInteger::VALUEfor 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
Stringableimport and updated provider namespace path correctly align with the relocated provider structure.
69-75: LGTM!The expanded parameter types
string|Stringable|UnitEnum|nullfor$charsetandstring|Stringable|UnitEnumfor$expectedValuecorrectly match theCharsetProvider::values()return type and theHasCharset::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
StringableandUnitEnumtype coverage.
29-34: LGTM!The test data expansion is well-implemented:
- The
Stringablefixture 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:
Stringablefixture 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 forBackedInteger::VALUEshould match the hardcoded"1"expectations in assertions.The php-forge/support dependency is already present in
require-dev. However, verify thatBackedInteger::VALUEfrom phpforge/support ^0.3 actually has a backing value of1, 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
BackedStringandUnitenums are imported from the external packagephp-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 thephp-forge/supportpackage 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.
Pull Request