+ HTML,
+ TextArea::tag()
+ ->addAriaAttribute('describedby', 'value')
+ ->render(),
+ "Failed asserting that an explicit 'aria-describedby' string value is preserved.",
+ );
+ }
+
+ public function testRenderWithAddAriaDescribedByTrueBooleanValue(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->addAriaAttribute('describedby', true)
+ ->id('textarea')
+ ->render(),
+ "Failed asserting that element renders correctly with 'aria-describedby' attribute set to "
+ . "'true'.",
+ );
+ }
+
+ public function testRenderWithAddAriaDescribedByTrueBooleanValueAndIdNull(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->addAriaAttribute('describedby', true)
+ ->id(null)
+ ->render(),
+ "Failed asserting that element renders correctly with 'aria-describedby' attribute set to 'true' and 'id'"
+ . " is 'null'.",
+ );
+ }
+
+ public function testRenderWithAddAriaDescribedByTrueBooleanValueString(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->addAriaAttribute('describedby', 'true')
+ ->id('textarea')
+ ->render(),
+ "Failed asserting that element renders correctly with 'aria-describedby' attribute set to 'true'.",
+ );
+ }
+
public function testRenderWithAddDataAttribute(): void
{
self::assertSame(
@@ -180,6 +241,52 @@ public function testRenderWithAriaAttributes(): void
);
}
+ public function testRenderWithAriaAttributesAndAriaDescribedByTrueBooleanValue(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->ariaAttributes(['describedby' => true])
+ ->id('textarea')
+ ->render(),
+ "Failed asserting that element renders correctly with 'aria-describedby' attribute set to 'true'.",
+ );
+ }
+
+ public function testRenderWithAriaAttributesAndAriaDescribedByTrueStringValue(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->ariaAttributes(['describedby' => 'true'])
+ ->id('textarea')
+ ->render(),
+ "Failed asserting that element renders correctly with 'aria-describedby' attribute set to 'true'.",
+ );
+ }
+
+ public function testRenderWithAriaDescribedByCustomSuffix(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->addAriaAttribute('describedby', true)
+ ->ariaDescribedBySuffix('value')
+ ->id('textarea')
+ ->render(),
+ "Failed asserting that 'ariaDescribedBySuffix()' correctly applies the custom suffix.",
+ );
+ }
+
public function testRenderWithAttributes(): void
{
self::assertSame(
@@ -194,6 +301,36 @@ public function testRenderWithAttributes(): void
);
}
+ public function testRenderWithAttributesAndAriaDescribedByTrueBooleanValue(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->attributes(['aria-describedby' => true])
+ ->id('textarea')
+ ->render(),
+ "Failed asserting that element renders correctly with 'aria-describedby' attribute set to 'true'.",
+ );
+ }
+
+ public function testRenderWithAttributesAndAriaDescribedByTrueStringValue(): void
+ {
+ self::assertSame(
+ <<
+
+ HTML,
+ TextArea::tag()
+ ->attributes(['aria-describedby' => 'true'])
+ ->id('textarea')
+ ->render(),
+ "Failed asserting that element renders correctly with 'aria-describedby' attribute set to 'true'.",
+ );
+ }
+
public function testRenderWithAutocapitalize(): void
{
self::assertSame(
@@ -990,6 +1127,11 @@ public function testReturnNewInstanceWhenSettingAttribute(): void
{
$textArea = TextArea::tag();
+ self::assertNotSame(
+ $textArea,
+ $textArea->ariaDescribedBySuffix(''),
+ 'Should return a new instance when setting the attribute, ensuring immutability.',
+ );
self::assertNotSame(
$textArea,
$textArea->cols(1),
diff --git a/tests/Provider/Form/CheckedProvider.php b/tests/Provider/Form/CheckedProvider.php
index bee8dce..3bfeb44 100644
--- a/tests/Provider/Form/CheckedProvider.php
+++ b/tests/Provider/Form/CheckedProvider.php
@@ -36,7 +36,7 @@ public static function checked(): array
[1, 2],
1,
<<
+