From 109ae4056552f77d4150d8adec2fed90b6e1e7be Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Sun, 15 Feb 2026 16:06:11 -0300 Subject: [PATCH 1/3] fix(html): Update `ui-awesome/html-helper` to version `^0.7` and `ui-awesome/html-mixin` to version `^0.4` in `composer.json` and apply necessary changes to `src` and `tests` directories. --- composer.json | 7 +- src/Embedded/Attribute/HasElementtiming.php | 6 +- src/Embedded/Attribute/HasIsmap.php | 6 +- src/Form/Attribute/HasFormaction.php | 6 +- src/Form/Attribute/HasFormenctype.php | 6 +- src/Form/Attribute/HasFormmethod.php | 6 +- src/Form/Attribute/HasFormnovalidate.php | 6 +- src/Form/Attribute/HasFormtarget.php | 6 +- src/Form/Base/BaseChoice.php | 116 +++++++++++++ src/Form/InputCheckbox.php | 128 +-------------- src/Form/InputRadio.php | 121 +------------- src/Form/Mixin/CanBeUnchecked.php | 51 ++++++ src/Form/Mixin/HasLabel.php | 155 ------------------ src/List/Attribute/HasReversed.php | 6 +- src/List/Attribute/HasStart.php | 6 +- src/Metadata/Attribute/HasAsync.php | 6 +- src/Metadata/Attribute/HasDefer.php | 6 +- src/Metadata/Attribute/HasNomodule.php | 6 +- .../Attribute/HasShadowRootClonable.php | 6 +- .../Attribute/HasShadowRootDelegatesFocus.php | 6 +- src/Metadata/Attribute/HasShadowRootMode.php | 6 +- .../HasShadowRootReferenceTarget.php | 6 +- .../Attribute/HasShadowRootSerializable.php | 6 +- src/Phrasing/Label.php | 2 +- tests/Embedded/ImgTest.php | 12 +- tests/Flow/DivTest.php | 12 +- tests/Flow/HrTest.php | 12 +- tests/Flow/MainTest.php | 12 +- tests/Flow/PTest.php | 12 +- tests/Form/InputCheckboxTest.php | 12 +- tests/Form/InputHiddenTest.php | 10 +- tests/Form/InputImageTest.php | 10 +- tests/Form/InputMonthTest.php | 10 +- tests/Form/InputNumberTest.php | 10 +- tests/Form/InputPasswordTest.php | 10 +- tests/Form/InputRadioTest.php | 12 +- tests/Form/InputRangeTest.php | 10 +- tests/Form/InputResetTest.php | 10 +- tests/Form/InputSearchTest.php | 10 +- tests/Form/InputSubmitTest.php | 10 +- tests/Form/InputTelTest.php | 10 +- tests/Form/InputTextTest.php | 10 +- tests/Form/InputTimeTest.php | 10 +- tests/Form/InputUrlTest.php | 10 +- tests/Form/InputWeekTest.php | 10 +- tests/Heading/H1Test.php | 12 +- tests/Heading/H2Test.php | 12 +- tests/Heading/H3Test.php | 12 +- tests/Heading/H4Test.php | 12 +- tests/Heading/H5Test.php | 12 +- tests/Heading/H6Test.php | 12 +- tests/Heading/HGroupTest.php | 12 +- tests/List/DdTest.php | 12 +- tests/List/DlTest.php | 12 +- tests/List/DtTest.php | 12 +- tests/List/LiTest.php | 12 +- tests/List/OlTest.php | 12 +- tests/List/UlTest.php | 12 +- tests/Metadata/BaseTest.php | 12 +- tests/Metadata/LinkTest.php | 12 +- tests/Metadata/MetaTest.php | 12 +- tests/Metadata/NoScriptTest.php | 12 +- tests/Metadata/ScriptTest.php | 12 +- tests/Metadata/StyleTest.php | 12 +- tests/Metadata/TemplateTest.php | 12 +- tests/Metadata/TitleTest.php | 12 +- tests/Palpable/ATest.php | 12 +- tests/Phrasing/ITest.php | 12 +- tests/Phrasing/LabelTest.php | 12 +- tests/Phrasing/SpanTest.php | 12 +- tests/Root/BodyTest.php | 12 +- tests/Root/FooterTest.php | 12 +- tests/Root/HeadTest.php | 12 +- tests/Root/HeaderTest.php | 12 +- tests/Root/HtmlTest.php | 12 +- tests/Sectioning/ArticleTest.php | 12 +- tests/Sectioning/AsideTest.php | 12 +- tests/Sectioning/NavTest.php | 12 +- tests/Sectioning/SectionTest.php | 12 +- 79 files changed, 526 insertions(+), 788 deletions(-) create mode 100644 src/Form/Base/BaseChoice.php create mode 100644 src/Form/Mixin/CanBeUnchecked.php delete mode 100644 src/Form/Mixin/HasLabel.php diff --git a/composer.json b/composer.json index 4e1f9f3..4622b28 100644 --- a/composer.json +++ b/composer.json @@ -12,10 +12,11 @@ "require": { "php": "^8.1", "ext-mbstring": "*", - "ui-awesome/html-attribute": "dev-main as 0.5.2", + "ui-awesome/html-attribute": "^0.6@dev", "ui-awesome/html-core": "^0.6@dev", - "ui-awesome/html-helper": "^0.6", - "ui-awesome/html-interop": "^0.3" + "ui-awesome/html-helper": "^0.7", + "ui-awesome/html-interop": "^0.3", + "ui-awesome/html-mixin": "^0.4" }, "require-dev": { "infection/infection": "^0.27|^0.32", diff --git a/src/Embedded/Attribute/HasElementtiming.php b/src/Embedded/Attribute/HasElementtiming.php index 6ede488..0ee622c 100644 --- a/src/Embedded/Attribute/HasElementtiming.php +++ b/src/Embedded/Attribute/HasElementtiming.php @@ -9,9 +9,7 @@ /** * Provides an immutable API for the HTML `elementtiming` attribute. * - * @method static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/elementtiming * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -35,6 +33,6 @@ trait HasElementtiming */ public function elementtiming(string|UnitEnum|null $value): static { - return $this->addAttribute('elementtiming', $value); + return $this->setAttribute('elementtiming', $value); } } diff --git a/src/Embedded/Attribute/HasIsmap.php b/src/Embedded/Attribute/HasIsmap.php index e69cfcc..c50b7c6 100644 --- a/src/Embedded/Attribute/HasIsmap.php +++ b/src/Embedded/Attribute/HasIsmap.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `ismap` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#ismap * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -31,6 +29,6 @@ trait HasIsmap */ public function ismap(bool $value): static { - return $this->addAttribute('ismap', $value); + return $this->setAttribute('ismap', $value); } } diff --git a/src/Form/Attribute/HasFormaction.php b/src/Form/Attribute/HasFormaction.php index f32ab33..9dde767 100644 --- a/src/Form/Attribute/HasFormaction.php +++ b/src/Form/Attribute/HasFormaction.php @@ -10,9 +10,7 @@ /** * Provides an immutable API for the HTML `formaction` attribute. * - * @method static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/formaction * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -34,6 +32,6 @@ trait HasFormaction */ public function formaction(string|Stringable|UnitEnum|null $value): static { - return $this->addAttribute('formaction', $value); + return $this->setAttribute('formaction', $value); } } diff --git a/src/Form/Attribute/HasFormenctype.php b/src/Form/Attribute/HasFormenctype.php index d450e22..ec5bb9a 100644 --- a/src/Form/Attribute/HasFormenctype.php +++ b/src/Form/Attribute/HasFormenctype.php @@ -10,9 +10,7 @@ /** * Provides an immutable API for the HTML `formenctype` attribute. * - * @method static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/formenctype * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -35,6 +33,6 @@ trait HasFormenctype */ public function formenctype(string|Stringable|UnitEnum|null $value): static { - return $this->addAttribute('formenctype', $value); + return $this->setAttribute('formenctype', $value); } } diff --git a/src/Form/Attribute/HasFormmethod.php b/src/Form/Attribute/HasFormmethod.php index ef7840b..701ac54 100644 --- a/src/Form/Attribute/HasFormmethod.php +++ b/src/Form/Attribute/HasFormmethod.php @@ -10,9 +10,7 @@ /** * Provides an immutable API for the HTML `formmethod` attribute. * - * @method static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/formmethod * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -34,6 +32,6 @@ trait HasFormmethod */ public function formmethod(string|Stringable|UnitEnum|null $value): static { - return $this->addAttribute('formmethod', $value); + return $this->setAttribute('formmethod', $value); } } diff --git a/src/Form/Attribute/HasFormnovalidate.php b/src/Form/Attribute/HasFormnovalidate.php index d180bb4..ded5421 100644 --- a/src/Form/Attribute/HasFormnovalidate.php +++ b/src/Form/Attribute/HasFormnovalidate.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `formnovalidate` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/formnovalidate * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -31,6 +29,6 @@ trait HasFormnovalidate */ public function formnovalidate(bool|null $value): static { - return $this->addAttribute('formnovalidate', $value); + return $this->setAttribute('formnovalidate', $value); } } diff --git a/src/Form/Attribute/HasFormtarget.php b/src/Form/Attribute/HasFormtarget.php index ccdd462..2fcaf21 100644 --- a/src/Form/Attribute/HasFormtarget.php +++ b/src/Form/Attribute/HasFormtarget.php @@ -10,9 +10,7 @@ /** * Provides an immutable API for the HTML `formtarget` attribute. * - * @method static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/formtarget * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -35,6 +33,6 @@ trait HasFormtarget */ public function formtarget(string|Stringable|UnitEnum|null $value): static { - return $this->addAttribute('formtarget', $value); + return $this->setAttribute('formtarget', $value); } } diff --git a/src/Form/Base/BaseChoice.php b/src/Form/Base/BaseChoice.php new file mode 100644 index 0000000..57f77c3 --- /dev/null +++ b/src/Form/Base/BaseChoice.php @@ -0,0 +1,116 @@ +buildAttributes(parent::getAttributes()); + } + + + /** + * Renders the `` element with its attributes. + * + * @return string Rendered HTML for the `` element. + */ + protected function run(): string + { + /** @var string|null $id */ + $id = $this->getAttribute('id', null); + + $unchecked = ''; + $uncheckedValue = $this->getUncheckedValue(); + + if ($uncheckedValue !== null) { + /** @phpstan-var string $name */ + $name = $this->getAttribute('name', ''); + + $unchecked = InputHidden::tag() + ->id(null) + ->name($name) + ->value($uncheckedValue) + ->render(); + } + + $label = $this->getLabel(); + + if ($this->isLabel() === false) { + return $this->buildElement( + '', + [ + '{label}' => '', + '{unchecked}' => $unchecked, + ], + ); + } + + $labelAttributes = $this->getLabelAttributes(); + $labelTag = Label::tag()->attributes($labelAttributes); + + if ($this->enclosedByLabel === false) { + if (array_key_exists('for', $labelAttributes) === false) { + $labelTag = $labelTag->for($id); + } + + $labelTag = $labelTag->content($label); + + return $this->buildElement( + '', + [ + '{label}' => $labelTag, + '{unchecked}' => $unchecked, + ], + ); + } + + $labelTag = $labelTag + ->html( + "\n", + Html::element($this->getTag(), '', $this->getAttributes()), + "\n", + $label, + "\n", + ); + + return $this->buildElement( + '', + [ + '{tag}' => $labelTag, + '{label}' => '', + '{unchecked}' => $unchecked, + ], + ); + } +} diff --git a/src/Form/InputCheckbox.php b/src/Form/InputCheckbox.php index 7178533..0c8073f 100644 --- a/src/Form/InputCheckbox.php +++ b/src/Form/InputCheckbox.php @@ -4,19 +4,9 @@ namespace UIAwesome\Html\Form; -use Stringable; -use UIAwesome\Html\Attribute\Form\HasRequired; -use UIAwesome\Html\Attribute\Global\{CanBeAutofocus, HasTabindex}; -use UIAwesome\Html\Attribute\HasValue; use UIAwesome\Html\Attribute\Values\Type; -use UIAwesome\Html\Core\Element\BaseInput; -use UIAwesome\Html\Core\Html; -use UIAwesome\Html\Form\Mixin\{CanBeEnclosedByLabel, HasCheckedState, HasLabel}; +use UIAwesome\Html\Form\Base\BaseChoice; use UIAwesome\Html\Interop\{VoidInterface, Voids}; -use UIAwesome\Html\Phrasing\Label; -use UnitEnum; - -use function array_key_exists; /** * Represents the HTML `` element. @@ -38,52 +28,8 @@ * @copyright Copyright (C) 2026 Terabytesoftw. * @license https://opensource.org/license/bsd-3-clause BSD 3-Clause License. */ -final class InputCheckbox extends BaseInput +final class InputCheckbox extends BaseChoice { - use CanBeAutofocus; - use CanBeEnclosedByLabel; - use HasCheckedState; - use HasLabel; - use HasRequired; - use HasTabindex; - use HasValue; - - /** - * Value to be submitted when the checkbox is not checked. - * - * If set, an additional hidden input will be rendered with the same name as the checkbox and this value. - * - * This ensures that a value is always submitted for the checkbox, even when it is unchecked. - */ - private bool|float|int|string|Stringable|UnitEnum|null $uncheckedValue = null; - - /** - * Returns the array of HTML attributes for the element. - * - * @return array Attributes array assigned to the element. - * - * @phpstan-return mixed[] - */ - public function getAttributes(): array - { - return $this->buildAttributes(parent::getAttributes()); - } - - /** - * Set the value that should be submitted when the checkbox is not checked. - * - * @param bool|float|int|string|Stringable|UnitEnum|null $value Value to be submitted. - * - * @return static New instance with the updated `uncheckedValue` value. - */ - public function uncheckedValue(bool|float|int|string|Stringable|UnitEnum|null $value): static - { - $new = clone $this; - $new->uncheckedValue = $value; - - return $new; - } - /** * Returns the tag enumeration for the `` element. * @@ -108,74 +54,4 @@ protected function loadDefault(): array 'type' => [Type::CHECKBOX], ] + parent::loadDefault(); } - - /** - * Renders the `` element with its attributes. - * - * @return string Rendered HTML for the `` element. - */ - protected function run(): string - { - /** @var string|null $id */ - $id = $this->getAttribute('id', null); - - $unchecked = ''; - - if ($this->uncheckedValue !== null) { - /** @phpstan-var string $name */ - $name = $this->getAttribute('name', ''); - - $unchecked = InputHidden::tag() - ->id(null) - ->name($name) - ->value($this->uncheckedValue) - ->render(); - } - - if ($this->notLabel || $this->label === '') { - return $this->buildElement( - '', - [ - '{label}' => '', - '{unchecked}' => $unchecked, - ], - ); - } - - $labelTag = Label::tag()->attributes($this->labelAttributes); - - if ($this->enclosedByLabel === false) { - if (array_key_exists('for', $this->labelAttributes) === false) { - $labelTag = $labelTag->for($id); - } - - $labelTag = $labelTag->content($this->label); - - return $this->buildElement( - '', - [ - '{label}' => $labelTag, - '{unchecked}' => $unchecked, - ], - ); - } - - $labelTag = $labelTag - ->html( - "\n", - Html::element($this->getTag(), '', $this->getAttributes()), - "\n", - $this->label, - "\n", - ); - - return $this->buildElement( - '', - [ - '{tag}' => $labelTag, - '{label}' => '', - '{unchecked}' => $unchecked, - ], - ); - } } diff --git a/src/Form/InputRadio.php b/src/Form/InputRadio.php index 5d3129a..f3d7d18 100644 --- a/src/Form/InputRadio.php +++ b/src/Form/InputRadio.php @@ -4,19 +4,10 @@ namespace UIAwesome\Html\Form; -use Stringable; -use UIAwesome\Html\Attribute\Form\HasRequired; -use UIAwesome\Html\Attribute\Global\{CanBeAutofocus, HasTabindex}; -use UIAwesome\Html\Attribute\HasValue; use UIAwesome\Html\Attribute\Values\Type; -use UIAwesome\Html\Core\Element\BaseInput; use UIAwesome\Html\Core\Html; -use UIAwesome\Html\Form\Mixin\{CanBeEnclosedByLabel, HasCheckedState, HasLabel}; +use UIAwesome\Html\Form\Base\BaseChoice; use UIAwesome\Html\Interop\{VoidInterface, Voids}; -use UIAwesome\Html\Phrasing\Label; -use UnitEnum; - -use function array_key_exists; /** * Represents the HTML `` element. @@ -38,52 +29,8 @@ * @copyright Copyright (C) 2026 Terabytesoftw. * @license https://opensource.org/license/bsd-3-clause BSD 3-Clause License. */ -final class InputRadio extends BaseInput +final class InputRadio extends BaseChoice { - use CanBeAutofocus; - use CanBeEnclosedByLabel; - use HasCheckedState; - use HasLabel; - use HasRequired; - use HasTabindex; - use HasValue; - - /** - * Value to be submitted when the radio is not checked. - * - * If set, an additional hidden input will be rendered with the same name as the radio and this value. - * - * This ensures that a value is always submitted for the radio, even when it is unchecked. - */ - private bool|float|int|string|Stringable|UnitEnum|null $uncheckedValue = null; - - /** - * Returns the array of HTML attributes for the element. - * - * @return array Attributes array assigned to the element. - * - * @phpstan-return mixed[] - */ - public function getAttributes(): array - { - return $this->buildAttributes(parent::getAttributes()); - } - - /** - * Set the value that should be submitted when the radio is not checked. - * - * @param bool|float|int|string|Stringable|UnitEnum|null $value Value to be submitted. - * - * @return static New instance with the updated `uncheckedValue` value. - */ - public function uncheckedValue(bool|float|int|string|Stringable|UnitEnum|null $value): static - { - $new = clone $this; - $new->uncheckedValue = $value; - - return $new; - } - /** * Returns the tag enumeration for the `` element. * @@ -108,68 +55,4 @@ protected function loadDefault(): array 'type' => [Type::RADIO], ] + parent::loadDefault(); } - - /** - * Renders the `` element with its attributes. - * - * @return string Rendered HTML for the `` element. - */ - protected function run(): string - { - /** @var string|null $id */ - $id = $this->getAttribute('id', null); - - $unchecked = ''; - - if ($this->uncheckedValue !== null) { - /** @phpstan-var string $name */ - $name = $this->getAttribute('name', ''); - - $unchecked = InputHidden::tag() - ->id(null) - ->name($name) - ->value($this->uncheckedValue) - ->render(); - } - - if ($this->notLabel || $this->label === '') { - return $this->buildElement('', ['{label}' => '', '{unchecked}' => $unchecked]); - } - - $labelTag = Label::tag()->attributes($this->labelAttributes); - - if ($this->enclosedByLabel === false) { - if (array_key_exists('for', $this->labelAttributes) === false) { - $labelTag = $labelTag->for($id); - } - - $labelTag = $labelTag->content($this->label); - - return $this->buildElement( - '', - [ - '{label}' => $labelTag, - '{unchecked}' => $unchecked, - ], - ); - } - - $labelTag = $labelTag - ->html( - "\n", - Html::element($this->getTag(), '', $this->getAttributes()), - "\n", - $this->label, - "\n", - ); - - return $this->buildElement( - '', - [ - '{tag}' => $labelTag, - '{label}' => '', - '{unchecked}' => $unchecked, - ], - ); - } } diff --git a/src/Form/Mixin/CanBeUnchecked.php b/src/Form/Mixin/CanBeUnchecked.php new file mode 100644 index 0000000..312014c --- /dev/null +++ b/src/Form/Mixin/CanBeUnchecked.php @@ -0,0 +1,51 @@ +uncheckedValue = $value; + + return $new; + } + + /** + * Get the value that should be submitted when the element is not checked. + * + * @return bool|float|int|string|Stringable|UnitEnum|null Value to be submitted. + */ + private function getUncheckedValue(): bool|float|int|string|Stringable|UnitEnum|null + { + return $this->uncheckedValue; + } +} diff --git a/src/Form/Mixin/HasLabel.php b/src/Form/Mixin/HasLabel.php deleted file mode 100644 index cd4ba2e..0000000 --- a/src/Form/Mixin/HasLabel.php +++ /dev/null @@ -1,155 +0,0 @@ -label('My Label'); - * ``` - * - * @param string $content The label content. - * - * @return static New instance with the updated `label` value. - */ - public function label(string $content): static - { - $new = clone $this; - $new->label = $content; - - return $new; - } - - /** - * Sets the label attributes. - * - * Usage example: - * ```php - * $element->labelAttributes(['class' => 'form-label']); - * ``` - * - * @param array $attributes The label attributes. - * - * @return static New instance with the updated `labelAttributes` value. - * - * @phpstan-param mixed[] $attributes - */ - public function labelAttributes(array $attributes): static - { - $new = clone $this; - $new->labelAttributes = $attributes; - - return $new; - } - - /** - * Sets the `class` attribute of the label. - * - * Usage example: - * ```php - * $element->labelClass('my-class'); - * $element->labelClass(Theme::PRIMARY); - * $element->labelClass( - * new class implements Stringable { - * public function __toString(): string - * { - * return 'stringable-class'; - * } - * }, - * ); - * $element->labelClass('another-class', true); - * $element->labelClass(null); - * ``` - * - * @param string|Stringable|UnitEnum|null $value CSS class value, or `null` to remove the attribute. - * @param bool $override Whether to override existing classes (`true`) or merge (`false`). - * - * @return static New instance with the updated `labelAttributes['class']` value. - */ - public function labelClass(string|Stringable|UnitEnum|null $value, bool $override = false): static - { - $new = clone $this; - - if ($value === null) { - unset($new->labelAttributes['class']); - } else { - CSSClass::add($new->labelAttributes, $value, $override); - } - - return $new; - } - - /** - * Sets the `for` attribute of the label. - * - * Usage example: - * ```php - * $element->labelFor('input-id'); - * $element->labelFor(null); - * ``` - * - * @param string|null $value The value of the `for` attribute. - * - * @return static New instance with the updated `labelAttributes['for']` value. - */ - public function labelFor(string|null $value): static - { - $new = clone $this; - $new->labelAttributes['for'] = $value; - - return $new; - } - - /** - * Disables the label rendering. - * - * Usage example: - * ```php - * $element->notLabel(); - * ``` - * - * @return static New instance with the updated `notLabel` value. - */ - public function notLabel(): static - { - $new = clone $this; - $new->notLabel = true; - - return $new; - } -} diff --git a/src/List/Attribute/HasReversed.php b/src/List/Attribute/HasReversed.php index 750d3a1..7357a98 100644 --- a/src/List/Attribute/HasReversed.php +++ b/src/List/Attribute/HasReversed.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `reversed` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ol#reversed * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -31,6 +29,6 @@ trait HasReversed */ public function reversed(bool $value): static { - return $this->addAttribute('reversed', $value); + return $this->setAttribute('reversed', $value); } } diff --git a/src/List/Attribute/HasStart.php b/src/List/Attribute/HasStart.php index 0fcb19d..d909b19 100644 --- a/src/List/Attribute/HasStart.php +++ b/src/List/Attribute/HasStart.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `start` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ol#start * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -32,6 +30,6 @@ trait HasStart */ public function start(int|null $value): static { - return $this->addAttribute('start', $value); + return $this->setAttribute('start', $value); } } diff --git a/src/Metadata/Attribute/HasAsync.php b/src/Metadata/Attribute/HasAsync.php index a9a4e0a..24a42ef 100644 --- a/src/Metadata/Attribute/HasAsync.php +++ b/src/Metadata/Attribute/HasAsync.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `async` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script#async * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -34,6 +32,6 @@ trait HasAsync */ public function async(bool $value): static { - return $this->addAttribute('async', $value); + return $this->setAttribute('async', $value); } } diff --git a/src/Metadata/Attribute/HasDefer.php b/src/Metadata/Attribute/HasDefer.php index 4ac5491..c57f6f8 100644 --- a/src/Metadata/Attribute/HasDefer.php +++ b/src/Metadata/Attribute/HasDefer.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `defer` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script#defer * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -34,6 +32,6 @@ trait HasDefer */ public function defer(bool $value): static { - return $this->addAttribute('defer', $value); + return $this->setAttribute('defer', $value); } } diff --git a/src/Metadata/Attribute/HasNomodule.php b/src/Metadata/Attribute/HasNomodule.php index 5b57509..bbc9737 100644 --- a/src/Metadata/Attribute/HasNomodule.php +++ b/src/Metadata/Attribute/HasNomodule.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `nomodule` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script#nomodule * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -34,6 +32,6 @@ trait HasNomodule */ public function nomodule(bool $value): static { - return $this->addAttribute('nomodule', $value); + return $this->setAttribute('nomodule', $value); } } diff --git a/src/Metadata/Attribute/HasShadowRootClonable.php b/src/Metadata/Attribute/HasShadowRootClonable.php index 80b7c01..7bc0124 100644 --- a/src/Metadata/Attribute/HasShadowRootClonable.php +++ b/src/Metadata/Attribute/HasShadowRootClonable.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `shadowrootclonable` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template#shadowrootclonable * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -33,6 +31,6 @@ trait HasShadowRootClonable */ public function shadowRootClonable(bool $value): static { - return $this->addAttribute('shadowrootclonable', $value); + return $this->setAttribute('shadowrootclonable', $value); } } diff --git a/src/Metadata/Attribute/HasShadowRootDelegatesFocus.php b/src/Metadata/Attribute/HasShadowRootDelegatesFocus.php index 851a459..bcc0342 100644 --- a/src/Metadata/Attribute/HasShadowRootDelegatesFocus.php +++ b/src/Metadata/Attribute/HasShadowRootDelegatesFocus.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `shadowrootdelegatesfocus` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template#shadowrootdelegatesfocus * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -33,6 +31,6 @@ trait HasShadowRootDelegatesFocus */ public function shadowRootDelegatesFocus(bool $value): static { - return $this->addAttribute('shadowrootdelegatesfocus', $value); + return $this->setAttribute('shadowrootdelegatesfocus', $value); } } diff --git a/src/Metadata/Attribute/HasShadowRootMode.php b/src/Metadata/Attribute/HasShadowRootMode.php index 3f1349d..33b3ace 100644 --- a/src/Metadata/Attribute/HasShadowRootMode.php +++ b/src/Metadata/Attribute/HasShadowRootMode.php @@ -12,9 +12,7 @@ /** * Provides an immutable API for the HTML `shadowrootmode` attribute. * - * @method static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template#shadowrootmode * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -44,6 +42,6 @@ public function shadowRootMode(string|UnitEnum|null $value): static { Validator::oneOf($value, ShadowRootMode::cases(), 'shadowrootmode'); - return $this->addAttribute('shadowrootmode', $value); + return $this->setAttribute('shadowrootmode', $value); } } diff --git a/src/Metadata/Attribute/HasShadowRootReferenceTarget.php b/src/Metadata/Attribute/HasShadowRootReferenceTarget.php index 28c0734..49b5e25 100644 --- a/src/Metadata/Attribute/HasShadowRootReferenceTarget.php +++ b/src/Metadata/Attribute/HasShadowRootReferenceTarget.php @@ -10,9 +10,7 @@ /** * Provides an immutable API for the HTML `shadowrootreferencetarget` attribute. * - * @method static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template#shadowrootreferencetarget * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -36,6 +34,6 @@ trait HasShadowRootReferenceTarget */ public function shadowRootReferenceTarget(string|Stringable|UnitEnum|null $value): static { - return $this->addAttribute('shadowrootreferencetarget', $value); + return $this->setAttribute('shadowrootreferencetarget', $value); } } diff --git a/src/Metadata/Attribute/HasShadowRootSerializable.php b/src/Metadata/Attribute/HasShadowRootSerializable.php index 18c98f9..083f094 100644 --- a/src/Metadata/Attribute/HasShadowRootSerializable.php +++ b/src/Metadata/Attribute/HasShadowRootSerializable.php @@ -7,9 +7,7 @@ /** * Provides an immutable API for the HTML `shadowrootserializable` attribute. * - * @method static addAttribute(string|\UnitEnum $key, mixed $value) Adds an attribute and returns a new instance. - * {@see \UIAwesome\Html\Mixin\HasAttributes} for managing the underlying attributes array. - * + * @mixin \UIAwesome\Html\Mixin\HasAttributes * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template#shadowrootserializable * * @copyright Copyright (C) 2026 Terabytesoftw. @@ -33,6 +31,6 @@ trait HasShadowRootSerializable */ public function shadowRootSerializable(bool $value): static { - return $this->addAttribute('shadowrootserializable', $value); + return $this->setAttribute('shadowrootserializable', $value); } } diff --git a/src/Phrasing/Label.php b/src/Phrasing/Label.php index 1ff91cd..492f986 100644 --- a/src/Phrasing/Label.php +++ b/src/Phrasing/Label.php @@ -41,7 +41,7 @@ final class Label extends BaseInline */ public function for(string|null $value = null): static { - return $this->addAttribute('for', $value); + return $this->setAttribute('for', $value); } /** diff --git a/tests/Embedded/ImgTest.php b/tests/Embedded/ImgTest.php index 1f1e4d8..6e1cdca 100644 --- a/tests/Embedded/ImgTest.php +++ b/tests/Embedded/ImgTest.php @@ -60,7 +60,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Img::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -112,9 +112,9 @@ public function testRenderWithAddAttribute(): void HTML, Img::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -125,9 +125,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Img::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -557,7 +557,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Img::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Flow/DivTest.php b/tests/Flow/DivTest.php index 547b908..5f315f1 100644 --- a/tests/Flow/DivTest.php +++ b/tests/Flow/DivTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Div::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Div::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Div::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Div::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Flow/HrTest.php b/tests/Flow/HrTest.php index b7fb0f4..47f1468 100644 --- a/tests/Flow/HrTest.php +++ b/tests/Flow/HrTest.php @@ -48,7 +48,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Hr::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -100,9 +100,9 @@ public function testRenderWithAddAttribute(): void
HTML, Hr::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -113,9 +113,9 @@ public function testRenderWithAddAttributeUsingEnum(): void
HTML, Hr::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -350,7 +350,7 @@ public function testRenderWithRemoveAttribute(): void
HTML, Hr::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Flow/MainTest.php b/tests/Flow/MainTest.php index 6556b8a..a156d7e 100644 --- a/tests/Flow/MainTest.php +++ b/tests/Flow/MainTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Main::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Main::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Main::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Main::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Flow/PTest.php b/tests/Flow/PTest.php index 3b90694..47dcf8a 100644 --- a/tests/Flow/PTest.php +++ b/tests/Flow/PTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], P::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void

HTML, P::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void

HTML, P::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void

HTML, P::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Form/InputCheckboxTest.php b/tests/Form/InputCheckboxTest.php index e87778b..45c8c32 100644 --- a/tests/Form/InputCheckboxTest.php +++ b/tests/Form/InputCheckboxTest.php @@ -194,10 +194,10 @@ public function testRenderWithAddAttribute(): void HTML, InputCheckbox::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputcheckbox') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -208,10 +208,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputCheckbox::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select checkbox') + ->setAttribute(GlobalAttribute::TITLE, 'Select checkbox') ->id('inputcheckbox') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -739,7 +739,7 @@ public function testRenderWithLabelClassNullValue(): void self::assertSame( << - + HTML, InputCheckbox::tag() ->id('inputcheckbox') @@ -912,7 +912,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputCheckbox::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputcheckbox') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputHiddenTest.php b/tests/Form/InputHiddenTest.php index 6d7ab8a..6fd84e3 100644 --- a/tests/Form/InputHiddenTest.php +++ b/tests/Form/InputHiddenTest.php @@ -186,10 +186,10 @@ public function testRenderWithAddAttribute(): void HTML, InputHidden::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputhidden') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -200,10 +200,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputHidden::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Hidden input') + ->setAttribute(GlobalAttribute::TITLE, 'Hidden input') ->id('inputhidden') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -603,7 +603,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputHidden::tag() ->id('inputhidden') - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Form/InputImageTest.php b/tests/Form/InputImageTest.php index 2d59a6f..d38a3c7 100644 --- a/tests/Form/InputImageTest.php +++ b/tests/Form/InputImageTest.php @@ -188,10 +188,10 @@ public function testRenderWithAddAttribute(): void HTML, InputImage::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputimage') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -202,10 +202,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputImage::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select image') + ->setAttribute(GlobalAttribute::TITLE, 'Select image') ->id('inputimage') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -674,7 +674,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputImage::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputimage') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputMonthTest.php b/tests/Form/InputMonthTest.php index 24e94df..30b6ee6 100644 --- a/tests/Form/InputMonthTest.php +++ b/tests/Form/InputMonthTest.php @@ -187,10 +187,10 @@ public function testRenderWithAddAttribute(): void HTML, InputMonth::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputmonth') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -201,10 +201,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputMonth::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select month') + ->setAttribute(GlobalAttribute::TITLE, 'Select month') ->id('inputmonth') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -688,7 +688,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputMonth::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputmonth') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputNumberTest.php b/tests/Form/InputNumberTest.php index 6742a33..a66b61f 100644 --- a/tests/Form/InputNumberTest.php +++ b/tests/Form/InputNumberTest.php @@ -188,10 +188,10 @@ public function testRenderWithAddAttribute(): void HTML, InputNumber::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputnumber') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -202,10 +202,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputNumber::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select number') + ->setAttribute(GlobalAttribute::TITLE, 'Select number') ->id('inputnumber') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -703,7 +703,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputNumber::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputnumber') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputPasswordTest.php b/tests/Form/InputPasswordTest.php index 153c9db..6c87675 100644 --- a/tests/Form/InputPasswordTest.php +++ b/tests/Form/InputPasswordTest.php @@ -198,10 +198,10 @@ public function testRenderWithAddAttribute(): void HTML, InputPassword::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputpassword') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -212,10 +212,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputPassword::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Enter password') + ->setAttribute(GlobalAttribute::TITLE, 'Enter password') ->id('inputpassword') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -727,7 +727,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputPassword::tag() ->id('inputpassword') - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Form/InputRadioTest.php b/tests/Form/InputRadioTest.php index 5cf0d25..c670631 100644 --- a/tests/Form/InputRadioTest.php +++ b/tests/Form/InputRadioTest.php @@ -196,10 +196,10 @@ public function testRenderWithAddAttribute(): void HTML, InputRadio::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputradio') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -210,10 +210,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputRadio::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select radio') + ->setAttribute(GlobalAttribute::TITLE, 'Select radio') ->id('inputradio') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -748,7 +748,7 @@ public function testRenderWithLabelClassNullValue(): void self::assertSame( << - + HTML, InputRadio::tag() ->id('inputradio') @@ -921,7 +921,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputRadio::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputradio') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputRangeTest.php b/tests/Form/InputRangeTest.php index 5cd4e9c..6d790b2 100644 --- a/tests/Form/InputRangeTest.php +++ b/tests/Form/InputRangeTest.php @@ -187,10 +187,10 @@ public function testRenderWithAddAttribute(): void HTML, InputRange::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputrange') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -201,10 +201,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputRange::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select range') + ->setAttribute(GlobalAttribute::TITLE, 'Select range') ->id('inputrange') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -674,7 +674,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputRange::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputrange') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputResetTest.php b/tests/Form/InputResetTest.php index 14c115b..88598f6 100644 --- a/tests/Form/InputResetTest.php +++ b/tests/Form/InputResetTest.php @@ -187,10 +187,10 @@ public function testRenderWithAddAttribute(): void HTML, InputReset::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputreset') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -201,10 +201,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputReset::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Reset form') + ->setAttribute(GlobalAttribute::TITLE, 'Reset form') ->id('inputreset') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -575,7 +575,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputReset::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputreset') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputSearchTest.php b/tests/Form/InputSearchTest.php index 0822a8e..caaf70c 100644 --- a/tests/Form/InputSearchTest.php +++ b/tests/Form/InputSearchTest.php @@ -188,10 +188,10 @@ public function testRenderWithAddAttribute(): void HTML, InputSearch::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputsearch') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -201,8 +201,8 @@ public function testRenderWithAddAttributeUsingEnum(): void << HTML, - InputSearch::tag()->id('inputsearch')->addAttribute(GlobalAttribute::TITLE, 'Search here')->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + InputSearch::tag()->id('inputsearch')->setAttribute(GlobalAttribute::TITLE, 'Search here')->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -634,7 +634,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputSearch::tag() ->id('inputsearch') - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Form/InputSubmitTest.php b/tests/Form/InputSubmitTest.php index 5df585a..cc0cd14 100644 --- a/tests/Form/InputSubmitTest.php +++ b/tests/Form/InputSubmitTest.php @@ -187,10 +187,10 @@ public function testRenderWithAddAttribute(): void HTML, InputSubmit::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputsubmit') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -201,10 +201,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputSubmit::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Submit action') + ->setAttribute(GlobalAttribute::TITLE, 'Submit action') ->id('inputsubmit') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -687,7 +687,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputSubmit::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputsubmit') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputTelTest.php b/tests/Form/InputTelTest.php index 0fd7133..10aa095 100644 --- a/tests/Form/InputTelTest.php +++ b/tests/Form/InputTelTest.php @@ -189,10 +189,10 @@ public function testRenderWithAddAttribute(): void HTML, InputTel::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputtel') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -203,10 +203,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputTel::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select phone') + ->setAttribute(GlobalAttribute::TITLE, 'Select phone') ->id('inputtel') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -703,7 +703,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputTel::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputtel') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputTextTest.php b/tests/Form/InputTextTest.php index 5c898b8..1da1a33 100644 --- a/tests/Form/InputTextTest.php +++ b/tests/Form/InputTextTest.php @@ -188,10 +188,10 @@ public function testRenderWithAddAttribute(): void HTML, InputText::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputtext') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -202,10 +202,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputText::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Enter text') + ->setAttribute(GlobalAttribute::TITLE, 'Enter text') ->id('inputtext') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -716,7 +716,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputText::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputtext') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputTimeTest.php b/tests/Form/InputTimeTest.php index eee4e0c..e1f2c93 100644 --- a/tests/Form/InputTimeTest.php +++ b/tests/Form/InputTimeTest.php @@ -187,10 +187,10 @@ public function testRenderWithAddAttribute(): void HTML, InputTime::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputtime') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -201,10 +201,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputTime::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select time') + ->setAttribute(GlobalAttribute::TITLE, 'Select time') ->id('inputtime') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -688,7 +688,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputTime::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputtime') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputUrlTest.php b/tests/Form/InputUrlTest.php index 6de5081..7b60683 100644 --- a/tests/Form/InputUrlTest.php +++ b/tests/Form/InputUrlTest.php @@ -189,10 +189,10 @@ public function testRenderWithAddAttribute(): void HTML, InputUrl::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputurl') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -203,10 +203,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputUrl::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select url') + ->setAttribute(GlobalAttribute::TITLE, 'Select url') ->id('inputurl') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -703,7 +703,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputUrl::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputurl') ->removeAttribute('data-test') ->render(), diff --git a/tests/Form/InputWeekTest.php b/tests/Form/InputWeekTest.php index 82491ef..3f67fa2 100644 --- a/tests/Form/InputWeekTest.php +++ b/tests/Form/InputWeekTest.php @@ -188,10 +188,10 @@ public function testRenderWithAddAttribute(): void HTML, InputWeek::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputweek') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -202,10 +202,10 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, InputWeek::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Select week') + ->setAttribute(GlobalAttribute::TITLE, 'Select week') ->id('inputweek') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -687,7 +687,7 @@ public function testRenderWithRemoveAttribute(): void HTML, InputWeek::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->id('inputweek') ->removeAttribute('data-test') ->render(), diff --git a/tests/Heading/H1Test.php b/tests/Heading/H1Test.php index ff07dc6..bdfe10b 100644 --- a/tests/Heading/H1Test.php +++ b/tests/Heading/H1Test.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], H1::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, H1::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, H1::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, H1::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Heading/H2Test.php b/tests/Heading/H2Test.php index 9520107..822f723 100644 --- a/tests/Heading/H2Test.php +++ b/tests/Heading/H2Test.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], H2::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, H2::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, H2::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, H2::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Heading/H3Test.php b/tests/Heading/H3Test.php index 1896c43..a2478ca 100644 --- a/tests/Heading/H3Test.php +++ b/tests/Heading/H3Test.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], H3::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, H3::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, H3::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, H3::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Heading/H4Test.php b/tests/Heading/H4Test.php index f7e16a6..9adf1ea 100644 --- a/tests/Heading/H4Test.php +++ b/tests/Heading/H4Test.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], H4::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, H4::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, H4::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, H4::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Heading/H5Test.php b/tests/Heading/H5Test.php index cbc86da..64fe9bd 100644 --- a/tests/Heading/H5Test.php +++ b/tests/Heading/H5Test.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], H5::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, H5::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, H5::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -505,7 +505,7 @@ public function testRenderWithRemoveAttribute(): void HTML, H5::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Heading/H6Test.php b/tests/Heading/H6Test.php index 9147936..a763037 100644 --- a/tests/Heading/H6Test.php +++ b/tests/Heading/H6Test.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], H6::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, H6::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, H6::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, H6::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Heading/HGroupTest.php b/tests/Heading/HGroupTest.php index 21721bc..fe283c9 100644 --- a/tests/Heading/HGroupTest.php +++ b/tests/Heading/HGroupTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], HGroup::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, HGroup::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, HGroup::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, HGroup::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/List/DdTest.php b/tests/List/DdTest.php index 26089cf..70597c7 100644 --- a/tests/List/DdTest.php +++ b/tests/List/DdTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Dd::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Dd::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Dd::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Dd::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/List/DlTest.php b/tests/List/DlTest.php index cf4060b..5277e49 100644 --- a/tests/List/DlTest.php +++ b/tests/List/DlTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Dl::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Dl::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Dl::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -570,7 +570,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Dl::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/List/DtTest.php b/tests/List/DtTest.php index dafef19..7c16c22 100644 --- a/tests/List/DtTest.php +++ b/tests/List/DtTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Dt::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Dt::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Dt::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Dt::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/List/LiTest.php b/tests/List/LiTest.php index 1a2eed2..418f339 100644 --- a/tests/List/LiTest.php +++ b/tests/List/LiTest.php @@ -62,7 +62,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Li::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -133,9 +133,9 @@ public function testRenderWithAddAttribute(): void HTML, Li::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -147,9 +147,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Li::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -523,7 +523,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Li::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/List/OlTest.php b/tests/List/OlTest.php index 3d56eb9..625925e 100644 --- a/tests/List/OlTest.php +++ b/tests/List/OlTest.php @@ -62,7 +62,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Ol::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -133,9 +133,9 @@ public function testRenderWithAddAttribute(): void HTML, Ol::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -147,9 +147,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Ol::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -571,7 +571,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Ol::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/List/UlTest.php b/tests/List/UlTest.php index 432b26e..906ad29 100644 --- a/tests/List/UlTest.php +++ b/tests/List/UlTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Ul::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Ul::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Ul::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -568,7 +568,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Ul::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/BaseTest.php b/tests/Metadata/BaseTest.php index 36dfa20..9ba1f38 100644 --- a/tests/Metadata/BaseTest.php +++ b/tests/Metadata/BaseTest.php @@ -54,7 +54,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Base::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -106,9 +106,9 @@ public function testRenderWithAddAttribute(): void HTML, Base::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -119,9 +119,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Base::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Base URL') + ->setAttribute(GlobalAttribute::TITLE, 'Base URL') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -383,7 +383,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Base::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/LinkTest.php b/tests/Metadata/LinkTest.php index 708e5e7..d01ff3d 100644 --- a/tests/Metadata/LinkTest.php +++ b/tests/Metadata/LinkTest.php @@ -59,7 +59,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Link::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -111,9 +111,9 @@ public function testRenderWithAddAttribute(): void HTML, Link::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -124,9 +124,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Link::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Stylesheet') + ->setAttribute(GlobalAttribute::TITLE, 'Stylesheet') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -596,7 +596,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Link::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/MetaTest.php b/tests/Metadata/MetaTest.php index c69c7f9..7d3715c 100644 --- a/tests/Metadata/MetaTest.php +++ b/tests/Metadata/MetaTest.php @@ -54,7 +54,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Meta::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -106,9 +106,9 @@ public function testRenderWithAddAttribute(): void HTML, Meta::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -119,9 +119,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Meta::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Meta tag') + ->setAttribute(GlobalAttribute::TITLE, 'Meta tag') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -450,7 +450,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Meta::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/NoScriptTest.php b/tests/Metadata/NoScriptTest.php index 805b2a2..9def4fc 100644 --- a/tests/Metadata/NoScriptTest.php +++ b/tests/Metadata/NoScriptTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], NoScript::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, NoScript::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, NoScript::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Fallback content') + ->setAttribute(GlobalAttribute::TITLE, 'Fallback content') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -518,7 +518,7 @@ public function testRenderWithRemoveAttribute(): void HTML, NoScript::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/ScriptTest.php b/tests/Metadata/ScriptTest.php index 284805b..76e64cb 100644 --- a/tests/Metadata/ScriptTest.php +++ b/tests/Metadata/ScriptTest.php @@ -71,7 +71,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Script::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -142,9 +142,9 @@ public function testRenderWithAddAttribute(): void HTML, Script::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -156,9 +156,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Script::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -697,7 +697,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Script::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/StyleTest.php b/tests/Metadata/StyleTest.php index 491aebb..7a26a3c 100644 --- a/tests/Metadata/StyleTest.php +++ b/tests/Metadata/StyleTest.php @@ -67,7 +67,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Style::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -138,9 +138,9 @@ public function testRenderWithAddAttribute(): void HTML, Style::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -152,9 +152,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Style::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -581,7 +581,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Style::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/TemplateTest.php b/tests/Metadata/TemplateTest.php index 407df0c..aa939a3 100644 --- a/tests/Metadata/TemplateTest.php +++ b/tests/Metadata/TemplateTest.php @@ -68,7 +68,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Template::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -139,9 +139,9 @@ public function testRenderWithAddAttribute(): void HTML, Template::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -153,9 +153,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Template::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -526,7 +526,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Template::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Metadata/TitleTest.php b/tests/Metadata/TitleTest.php index 8cd6670..0e7e5a9 100644 --- a/tests/Metadata/TitleTest.php +++ b/tests/Metadata/TitleTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Title::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Title::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Title::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -519,7 +519,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Title::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Palpable/ATest.php b/tests/Palpable/ATest.php index 855253c..b8bdb27 100644 --- a/tests/Palpable/ATest.php +++ b/tests/Palpable/ATest.php @@ -67,7 +67,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], A::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, A::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -145,9 +145,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, A::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Link content') + ->setAttribute(GlobalAttribute::TITLE, 'Link content') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -527,7 +527,7 @@ public function testRenderWithRemoveAttribute(): void HTML, A::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Phrasing/ITest.php b/tests/Phrasing/ITest.php index 49b6d65..9901ffe 100644 --- a/tests/Phrasing/ITest.php +++ b/tests/Phrasing/ITest.php @@ -59,7 +59,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], I::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -124,9 +124,9 @@ public function testRenderWithAddAttribute(): void HTML, I::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -137,9 +137,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, I::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Idiomatic text') + ->setAttribute(GlobalAttribute::TITLE, 'Idiomatic text') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -389,7 +389,7 @@ public function testRenderWithRemoveAttribute(): void HTML, I::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Phrasing/LabelTest.php b/tests/Phrasing/LabelTest.php index efb4b3e..a2ecdbf 100644 --- a/tests/Phrasing/LabelTest.php +++ b/tests/Phrasing/LabelTest.php @@ -59,7 +59,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Label::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -124,9 +124,9 @@ public function testRenderWithAddAttribute(): void HTML, Label::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -137,9 +137,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Label::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Label content') + ->setAttribute(GlobalAttribute::TITLE, 'Label content') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -402,7 +402,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Label::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Phrasing/SpanTest.php b/tests/Phrasing/SpanTest.php index 1fbcc93..f514dc8 100644 --- a/tests/Phrasing/SpanTest.php +++ b/tests/Phrasing/SpanTest.php @@ -59,7 +59,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Span::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -122,9 +122,9 @@ public function testRenderWithAddAttribute(): void HTML, Span::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -135,9 +135,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Span::tag() - ->addAttribute(GlobalAttribute::TITLE, 'Span content') + ->setAttribute(GlobalAttribute::TITLE, 'Span content') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -387,7 +387,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Span::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Root/BodyTest.php b/tests/Root/BodyTest.php index 9b15e5b..6093d2b 100644 --- a/tests/Root/BodyTest.php +++ b/tests/Root/BodyTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Body::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Body::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Body::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Body::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Root/FooterTest.php b/tests/Root/FooterTest.php index 5e84ae9..76e7b89 100644 --- a/tests/Root/FooterTest.php +++ b/tests/Root/FooterTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Footer::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Footer::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Footer::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Footer::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Root/HeadTest.php b/tests/Root/HeadTest.php index b5f5b5b..b5f3c36 100644 --- a/tests/Root/HeadTest.php +++ b/tests/Root/HeadTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Head::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Head::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Head::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Head::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Root/HeaderTest.php b/tests/Root/HeaderTest.php index d0470cf..11bfc8c 100644 --- a/tests/Root/HeaderTest.php +++ b/tests/Root/HeaderTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Header::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Header::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Header::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Header::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Root/HtmlTest.php b/tests/Root/HtmlTest.php index 5e1f348..11f2f83 100644 --- a/tests/Root/HtmlTest.php +++ b/tests/Root/HtmlTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Html::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Html::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Html::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Html::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Sectioning/ArticleTest.php b/tests/Sectioning/ArticleTest.php index 3558649..c9a721a 100644 --- a/tests/Sectioning/ArticleTest.php +++ b/tests/Sectioning/ArticleTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Article::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Article::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Article::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Article::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Sectioning/AsideTest.php b/tests/Sectioning/AsideTest.php index 0fc448e..2a08d49 100644 --- a/tests/Sectioning/AsideTest.php +++ b/tests/Sectioning/AsideTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Aside::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Aside::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Aside::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Aside::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Sectioning/NavTest.php b/tests/Sectioning/NavTest.php index 1afd8d2..3779564 100644 --- a/tests/Sectioning/NavTest.php +++ b/tests/Sectioning/NavTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Nav::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Nav::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Nav::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Nav::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", diff --git a/tests/Sectioning/SectionTest.php b/tests/Sectioning/SectionTest.php index fd5c210..078ba35 100644 --- a/tests/Sectioning/SectionTest.php +++ b/tests/Sectioning/SectionTest.php @@ -61,7 +61,7 @@ public function testGetAttributesReturnsAssignedAttributes(): void self::assertSame( ['data-test' => 'value'], Section::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->getAttributes(), "Failed asserting that 'getAttributes()' returns the assigned attributes.", ); @@ -132,9 +132,9 @@ public function testRenderWithAddAttribute(): void HTML, Section::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method.", + "Failed asserting that element renders correctly with 'setAttribute()' method.", ); } @@ -146,9 +146,9 @@ public function testRenderWithAddAttributeUsingEnum(): void HTML, Section::tag() - ->addAttribute(GlobalAttribute::TITLE, 'value') + ->setAttribute(GlobalAttribute::TITLE, 'value') ->render(), - "Failed asserting that element renders correctly with 'addAttribute()' method using enum.", + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", ); } @@ -507,7 +507,7 @@ public function testRenderWithRemoveAttribute(): void HTML, Section::tag() - ->addAttribute('data-test', 'value') + ->setAttribute('data-test', 'value') ->removeAttribute('data-test') ->render(), "Failed asserting that element renders correctly with 'removeAttribute()' method.", From ad1ad402e83f81bba586955a85fcde771c5cf92c Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Sun, 15 Feb 2026 19:06:30 +0000 Subject: [PATCH 2/3] Apply fixes from StyleCI --- src/Form/Base/BaseChoice.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Form/Base/BaseChoice.php b/src/Form/Base/BaseChoice.php index 57f77c3..ef92adf 100644 --- a/src/Form/Base/BaseChoice.php +++ b/src/Form/Base/BaseChoice.php @@ -39,7 +39,6 @@ public function getAttributes(): array return $this->buildAttributes(parent::getAttributes()); } - /** * Renders the `` element with its attributes. * From 2de55288395f9809d50fab1740fc37d82a16b4c6 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Sun, 15 Feb 2026 16:20:38 -0300 Subject: [PATCH 3/3] Apply fixed Coderabbitai review. --- CHANGELOG.md | 1 + src/Form/InputRadio.php | 1 - tests/Embedded/ImgTest.php | 52 ++++++++++++++--------------- tests/Flow/DivTest.php | 56 ++++++++++++++++---------------- tests/Flow/HrTest.php | 52 ++++++++++++++--------------- tests/Flow/MainTest.php | 56 ++++++++++++++++---------------- tests/Flow/PTest.php | 56 ++++++++++++++++---------------- tests/Form/InputCheckboxTest.php | 56 ++++++++++++++++---------------- tests/Form/InputHiddenTest.php | 56 ++++++++++++++++---------------- tests/Form/InputImageTest.php | 56 ++++++++++++++++---------------- tests/Form/InputMonthTest.php | 56 ++++++++++++++++---------------- tests/Form/InputNumberTest.php | 56 ++++++++++++++++---------------- tests/Form/InputPasswordTest.php | 56 ++++++++++++++++---------------- tests/Form/InputRadioTest.php | 56 ++++++++++++++++---------------- tests/Form/InputRangeTest.php | 56 ++++++++++++++++---------------- tests/Form/InputResetTest.php | 56 ++++++++++++++++---------------- tests/Form/InputSearchTest.php | 50 ++++++++++++++-------------- tests/Form/InputSubmitTest.php | 56 ++++++++++++++++---------------- tests/Form/InputTelTest.php | 56 ++++++++++++++++---------------- tests/Form/InputTextTest.php | 56 ++++++++++++++++---------------- tests/Form/InputTimeTest.php | 56 ++++++++++++++++---------------- tests/Form/InputUrlTest.php | 56 ++++++++++++++++---------------- tests/Form/InputWeekTest.php | 56 ++++++++++++++++---------------- tests/Heading/H1Test.php | 56 ++++++++++++++++---------------- tests/Heading/H2Test.php | 56 ++++++++++++++++---------------- tests/Heading/H3Test.php | 56 ++++++++++++++++---------------- tests/Heading/H4Test.php | 56 ++++++++++++++++---------------- tests/Heading/H5Test.php | 56 ++++++++++++++++---------------- tests/Heading/H6Test.php | 56 ++++++++++++++++---------------- tests/Heading/HGroupTest.php | 56 ++++++++++++++++---------------- tests/List/DdTest.php | 56 ++++++++++++++++---------------- tests/List/DlTest.php | 56 ++++++++++++++++---------------- tests/List/DtTest.php | 56 ++++++++++++++++---------------- tests/List/LiTest.php | 56 ++++++++++++++++---------------- tests/List/OlTest.php | 56 ++++++++++++++++---------------- tests/List/UlTest.php | 56 ++++++++++++++++---------------- tests/Metadata/BaseTest.php | 52 ++++++++++++++--------------- tests/Metadata/LinkTest.php | 52 ++++++++++++++--------------- tests/Metadata/MetaTest.php | 52 ++++++++++++++--------------- tests/Metadata/NoScriptTest.php | 56 ++++++++++++++++---------------- tests/Metadata/ScriptTest.php | 56 ++++++++++++++++---------------- tests/Metadata/StyleTest.php | 56 ++++++++++++++++---------------- tests/Metadata/TemplateTest.php | 56 ++++++++++++++++---------------- tests/Metadata/TitleTest.php | 56 ++++++++++++++++---------------- tests/Palpable/ATest.php | 52 ++++++++++++++--------------- tests/Phrasing/ITest.php | 52 ++++++++++++++--------------- tests/Phrasing/LabelTest.php | 52 ++++++++++++++--------------- tests/Phrasing/SpanTest.php | 52 ++++++++++++++--------------- tests/Root/BodyTest.php | 56 ++++++++++++++++---------------- tests/Root/FooterTest.php | 56 ++++++++++++++++---------------- tests/Root/HeadTest.php | 56 ++++++++++++++++---------------- tests/Root/HeaderTest.php | 56 ++++++++++++++++---------------- tests/Root/HtmlTest.php | 56 ++++++++++++++++---------------- tests/Sectioning/ArticleTest.php | 56 ++++++++++++++++---------------- tests/Sectioning/AsideTest.php | 56 ++++++++++++++++---------------- tests/Sectioning/NavTest.php | 56 ++++++++++++++++---------------- tests/Sectioning/SectionTest.php | 56 ++++++++++++++++---------------- 57 files changed, 1520 insertions(+), 1520 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81e720a..dfb83a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Bug #40: Refactor tests to use `assertSame()` for rendering with `testRenderWithGlobalDefaultsAreApplied()` and `testRenderWithUserOverridesGlobalDefaults()` (@terabytesoftw) - Enh #41: Add `InputImage` class for HTML `` element with attributes and rendering capabilities (@terabytesoftw) - Bug #42: Fix messages in `assert()` methods and code style (@terabytesoftw) +- Bug #43: Update `ui-awesome/html-helper` to version `^0.7` and `ui-awesome/html-mixin` to version `^0.4` in `composer.json` and apply necessary changes to `src` and `tests` directories (@terabytesoftw) ## 0.3.0 March 31, 2024 diff --git a/src/Form/InputRadio.php b/src/Form/InputRadio.php index f3d7d18..9d56381 100644 --- a/src/Form/InputRadio.php +++ b/src/Form/InputRadio.php @@ -5,7 +5,6 @@ namespace UIAwesome\Html\Form; use UIAwesome\Html\Attribute\Values\Type; -use UIAwesome\Html\Core\Html; use UIAwesome\Html\Form\Base\BaseChoice; use UIAwesome\Html\Interop\{VoidInterface, Voids}; diff --git a/tests/Embedded/ImgTest.php b/tests/Embedded/ImgTest.php index 6e1cdca..c9c6853 100644 --- a/tests/Embedded/ImgTest.php +++ b/tests/Embedded/ImgTest.php @@ -105,32 +105,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - Img::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - Img::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -604,6 +578,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + Img::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + Img::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSizes(): void { self::assertSame( diff --git a/tests/Flow/DivTest.php b/tests/Flow/DivTest.php index 5f315f1..bd1c6eb 100644 --- a/tests/Flow/DivTest.php +++ b/tests/Flow/DivTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Div::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Div::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Div::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Div::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Flow/HrTest.php b/tests/Flow/HrTest.php index 47f1468..ff93253 100644 --- a/tests/Flow/HrTest.php +++ b/tests/Flow/HrTest.php @@ -93,32 +93,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - Hr::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - Hr::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -397,6 +371,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + Hr::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + Hr::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Flow/MainTest.php b/tests/Flow/MainTest.php index a156d7e..39ca699 100644 --- a/tests/Flow/MainTest.php +++ b/tests/Flow/MainTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Main::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Main::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Main::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Main::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Flow/PTest.php b/tests/Flow/PTest.php index 47dcf8a..cb5ba85 100644 --- a/tests/Flow/PTest.php +++ b/tests/Flow/PTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << -

- HTML, - P::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << -

- HTML, - P::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << +

+ HTML, + P::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << +

+ HTML, + P::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Form/InputCheckboxTest.php b/tests/Form/InputCheckboxTest.php index 45c8c32..3bfde27 100644 --- a/tests/Form/InputCheckboxTest.php +++ b/tests/Form/InputCheckboxTest.php @@ -187,34 +187,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputCheckbox::tag() - ->setAttribute('data-test', 'value') - ->id('inputcheckbox') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputCheckbox::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select checkbox') - ->id('inputcheckbox') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -977,6 +949,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputCheckbox::tag() + ->setAttribute('data-test', 'value') + ->id('inputcheckbox') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputCheckbox::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select checkbox') + ->id('inputcheckbox') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Form/InputHiddenTest.php b/tests/Form/InputHiddenTest.php index 6fd84e3..ebdd652 100644 --- a/tests/Form/InputHiddenTest.php +++ b/tests/Form/InputHiddenTest.php @@ -179,34 +179,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputHidden::tag() - ->setAttribute('data-test', 'value') - ->id('inputhidden') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputHidden::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Hidden input') - ->id('inputhidden') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -653,6 +625,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputHidden::tag() + ->setAttribute('data-test', 'value') + ->id('inputhidden') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputHidden::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Hidden input') + ->id('inputhidden') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Form/InputImageTest.php b/tests/Form/InputImageTest.php index d38a3c7..60795bf 100644 --- a/tests/Form/InputImageTest.php +++ b/tests/Form/InputImageTest.php @@ -181,34 +181,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputImage::tag() - ->setAttribute('data-test', 'value') - ->id('inputimage') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputImage::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select image') - ->id('inputimage') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -725,6 +697,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputImage::tag() + ->setAttribute('data-test', 'value') + ->id('inputimage') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputImage::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select image') + ->id('inputimage') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSrc(): void { self::assertSame( diff --git a/tests/Form/InputMonthTest.php b/tests/Form/InputMonthTest.php index 30b6ee6..4bee7db 100644 --- a/tests/Form/InputMonthTest.php +++ b/tests/Form/InputMonthTest.php @@ -180,34 +180,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputMonth::tag() - ->setAttribute('data-test', 'value') - ->id('inputmonth') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputMonth::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select month') - ->id('inputmonth') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -753,6 +725,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputMonth::tag() + ->setAttribute('data-test', 'value') + ->id('inputmonth') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputMonth::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select month') + ->id('inputmonth') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStep(): void { self::assertSame( diff --git a/tests/Form/InputNumberTest.php b/tests/Form/InputNumberTest.php index a66b61f..f4ea285 100644 --- a/tests/Form/InputNumberTest.php +++ b/tests/Form/InputNumberTest.php @@ -181,34 +181,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputNumber::tag() - ->setAttribute('data-test', 'value') - ->id('inputnumber') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputNumber::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select number') - ->id('inputnumber') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -768,6 +740,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputNumber::tag() + ->setAttribute('data-test', 'value') + ->id('inputnumber') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputNumber::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select number') + ->id('inputnumber') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStep(): void { self::assertSame( diff --git a/tests/Form/InputPasswordTest.php b/tests/Form/InputPasswordTest.php index 6c87675..27c3d97 100644 --- a/tests/Form/InputPasswordTest.php +++ b/tests/Form/InputPasswordTest.php @@ -191,34 +191,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputPassword::tag() - ->setAttribute('data-test', 'value') - ->id('inputpassword') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputPassword::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Enter password') - ->id('inputpassword') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -791,6 +763,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputPassword::tag() + ->setAttribute('data-test', 'value') + ->id('inputpassword') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputPassword::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Enter password') + ->id('inputpassword') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSize(): void { self::assertSame( diff --git a/tests/Form/InputRadioTest.php b/tests/Form/InputRadioTest.php index c670631..1e91026 100644 --- a/tests/Form/InputRadioTest.php +++ b/tests/Form/InputRadioTest.php @@ -189,34 +189,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputRadio::tag() - ->setAttribute('data-test', 'value') - ->id('inputradio') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputRadio::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select radio') - ->id('inputradio') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -986,6 +958,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputRadio::tag() + ->setAttribute('data-test', 'value') + ->id('inputradio') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputRadio::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select radio') + ->id('inputradio') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Form/InputRangeTest.php b/tests/Form/InputRangeTest.php index 6d790b2..f8c91fc 100644 --- a/tests/Form/InputRangeTest.php +++ b/tests/Form/InputRangeTest.php @@ -180,34 +180,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputRange::tag() - ->setAttribute('data-test', 'value') - ->id('inputrange') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputRange::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select range') - ->id('inputrange') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -725,6 +697,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputRange::tag() + ->setAttribute('data-test', 'value') + ->id('inputrange') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputRange::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select range') + ->id('inputrange') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStep(): void { self::assertSame( diff --git a/tests/Form/InputResetTest.php b/tests/Form/InputResetTest.php index 88598f6..b14f9fe 100644 --- a/tests/Form/InputResetTest.php +++ b/tests/Form/InputResetTest.php @@ -180,34 +180,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputReset::tag() - ->setAttribute('data-test', 'value') - ->id('inputreset') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputReset::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Reset form') - ->id('inputreset') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -626,6 +598,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputReset::tag() + ->setAttribute('data-test', 'value') + ->id('inputreset') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputReset::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Reset form') + ->id('inputreset') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Form/InputSearchTest.php b/tests/Form/InputSearchTest.php index caaf70c..4921a86 100644 --- a/tests/Form/InputSearchTest.php +++ b/tests/Form/InputSearchTest.php @@ -181,31 +181,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputSearch::tag() - ->setAttribute('data-test', 'value') - ->id('inputsearch') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputSearch::tag()->id('inputsearch')->setAttribute(GlobalAttribute::TITLE, 'Search here')->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -689,6 +664,31 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputSearch::tag() + ->setAttribute('data-test', 'value') + ->id('inputsearch') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputSearch::tag()->id('inputsearch')->setAttribute(GlobalAttribute::TITLE, 'Search here')->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSize(): void { self::assertSame( diff --git a/tests/Form/InputSubmitTest.php b/tests/Form/InputSubmitTest.php index cc0cd14..61fb795 100644 --- a/tests/Form/InputSubmitTest.php +++ b/tests/Form/InputSubmitTest.php @@ -180,34 +180,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputSubmit::tag() - ->setAttribute('data-test', 'value') - ->id('inputsubmit') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputSubmit::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Submit action') - ->id('inputsubmit') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -738,6 +710,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputSubmit::tag() + ->setAttribute('data-test', 'value') + ->id('inputsubmit') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputSubmit::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Submit action') + ->id('inputsubmit') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Form/InputTelTest.php b/tests/Form/InputTelTest.php index 10aa095..d28403a 100644 --- a/tests/Form/InputTelTest.php +++ b/tests/Form/InputTelTest.php @@ -182,34 +182,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputTel::tag() - ->setAttribute('data-test', 'value') - ->id('inputtel') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputTel::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select phone') - ->id('inputtel') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -768,6 +740,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputTel::tag() + ->setAttribute('data-test', 'value') + ->id('inputtel') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputTel::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select phone') + ->id('inputtel') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSize(): void { self::assertSame( diff --git a/tests/Form/InputTextTest.php b/tests/Form/InputTextTest.php index 1da1a33..63bcc44 100644 --- a/tests/Form/InputTextTest.php +++ b/tests/Form/InputTextTest.php @@ -181,34 +181,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputText::tag() - ->setAttribute('data-test', 'value') - ->id('inputtext') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputText::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Enter text') - ->id('inputtext') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -781,6 +753,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputText::tag() + ->setAttribute('data-test', 'value') + ->id('inputtext') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputText::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Enter text') + ->id('inputtext') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSize(): void { self::assertSame( diff --git a/tests/Form/InputTimeTest.php b/tests/Form/InputTimeTest.php index e1f2c93..7322fd1 100644 --- a/tests/Form/InputTimeTest.php +++ b/tests/Form/InputTimeTest.php @@ -180,34 +180,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputTime::tag() - ->setAttribute('data-test', 'value') - ->id('inputtime') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputTime::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select time') - ->id('inputtime') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -753,6 +725,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputTime::tag() + ->setAttribute('data-test', 'value') + ->id('inputtime') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputTime::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select time') + ->id('inputtime') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStep(): void { self::assertSame( diff --git a/tests/Form/InputUrlTest.php b/tests/Form/InputUrlTest.php index 7b60683..44cd4a4 100644 --- a/tests/Form/InputUrlTest.php +++ b/tests/Form/InputUrlTest.php @@ -182,34 +182,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputUrl::tag() - ->setAttribute('data-test', 'value') - ->id('inputurl') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputUrl::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select url') - ->id('inputurl') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -768,6 +740,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputUrl::tag() + ->setAttribute('data-test', 'value') + ->id('inputurl') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputUrl::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select url') + ->id('inputurl') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSize(): void { self::assertSame( diff --git a/tests/Form/InputWeekTest.php b/tests/Form/InputWeekTest.php index 3f67fa2..2ee1b48 100644 --- a/tests/Form/InputWeekTest.php +++ b/tests/Form/InputWeekTest.php @@ -181,34 +181,6 @@ public function testRenderWithAddAriaDescribedByTrueStringValueAndPrefixSuffix() ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - InputWeek::tag() - ->setAttribute('data-test', 'value') - ->id('inputweek') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - InputWeek::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Select week') - ->id('inputweek') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -752,6 +724,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + InputWeek::tag() + ->setAttribute('data-test', 'value') + ->id('inputweek') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + InputWeek::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Select week') + ->id('inputweek') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStep(): void { self::assertSame( diff --git a/tests/Heading/H1Test.php b/tests/Heading/H1Test.php index bdfe10b..97fc106 100644 --- a/tests/Heading/H1Test.php +++ b/tests/Heading/H1Test.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - H1::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - H1::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + H1::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + H1::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Heading/H2Test.php b/tests/Heading/H2Test.php index 822f723..19dd0bb 100644 --- a/tests/Heading/H2Test.php +++ b/tests/Heading/H2Test.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - H2::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - H2::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + H2::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + H2::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Heading/H3Test.php b/tests/Heading/H3Test.php index a2478ca..3f3cdab 100644 --- a/tests/Heading/H3Test.php +++ b/tests/Heading/H3Test.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - H3::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - H3::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + H3::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + H3::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Heading/H4Test.php b/tests/Heading/H4Test.php index 9adf1ea..6ca1acf 100644 --- a/tests/Heading/H4Test.php +++ b/tests/Heading/H4Test.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - H4::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - H4::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + H4::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + H4::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Heading/H5Test.php b/tests/Heading/H5Test.php index 64fe9bd..f151388 100644 --- a/tests/Heading/H5Test.php +++ b/tests/Heading/H5Test.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - H5::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - H5::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -555,6 +527,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + H5::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + H5::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Heading/H6Test.php b/tests/Heading/H6Test.php index a763037..647fa72 100644 --- a/tests/Heading/H6Test.php +++ b/tests/Heading/H6Test.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - H6::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - H6::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + H6::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + H6::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Heading/HGroupTest.php b/tests/Heading/HGroupTest.php index fe283c9..53ca844 100644 --- a/tests/Heading/HGroupTest.php +++ b/tests/Heading/HGroupTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - HGroup::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - HGroup::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + HGroup::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + HGroup::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/List/DdTest.php b/tests/List/DdTest.php index 70597c7..b03f3e2 100644 --- a/tests/List/DdTest.php +++ b/tests/List/DdTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Dd::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Dd::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Dd::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Dd::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/List/DlTest.php b/tests/List/DlTest.php index 5277e49..fa3c6fd 100644 --- a/tests/List/DlTest.php +++ b/tests/List/DlTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Dl::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Dl::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -620,6 +592,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Dl::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Dl::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/List/DtTest.php b/tests/List/DtTest.php index 7c16c22..0021f90 100644 --- a/tests/List/DtTest.php +++ b/tests/List/DtTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Dt::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Dt::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Dt::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Dt::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/List/LiTest.php b/tests/List/LiTest.php index 418f339..513bff2 100644 --- a/tests/List/LiTest.php +++ b/tests/List/LiTest.php @@ -125,34 +125,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Li::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Li::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -573,6 +545,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Li::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Li::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/List/OlTest.php b/tests/List/OlTest.php index 625925e..986bd49 100644 --- a/tests/List/OlTest.php +++ b/tests/List/OlTest.php @@ -125,34 +125,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Ol::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Ol::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -639,6 +611,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Ol::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Ol::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/List/UlTest.php b/tests/List/UlTest.php index 906ad29..4564b28 100644 --- a/tests/List/UlTest.php +++ b/tests/List/UlTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Ul::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Ul::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -618,6 +590,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Ul::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Ul::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Metadata/BaseTest.php b/tests/Metadata/BaseTest.php index 9ba1f38..d456a9b 100644 --- a/tests/Metadata/BaseTest.php +++ b/tests/Metadata/BaseTest.php @@ -99,32 +99,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - Base::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - Base::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Base URL') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -430,6 +404,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + Base::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + Base::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Base URL') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Metadata/LinkTest.php b/tests/Metadata/LinkTest.php index d01ff3d..e202617 100644 --- a/tests/Metadata/LinkTest.php +++ b/tests/Metadata/LinkTest.php @@ -104,32 +104,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - Link::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - Link::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Stylesheet') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -643,6 +617,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + Link::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + Link::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Stylesheet') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSizes(): void { self::assertSame( diff --git a/tests/Metadata/MetaTest.php b/tests/Metadata/MetaTest.php index 7d3715c..3491267 100644 --- a/tests/Metadata/MetaTest.php +++ b/tests/Metadata/MetaTest.php @@ -99,32 +99,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - Meta::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - Meta::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Meta tag') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -495,6 +469,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + Meta::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + Meta::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Meta tag') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Metadata/NoScriptTest.php b/tests/Metadata/NoScriptTest.php index 9def4fc..5c47971 100644 --- a/tests/Metadata/NoScriptTest.php +++ b/tests/Metadata/NoScriptTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - NoScript::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - NoScript::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Fallback content') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -568,6 +540,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + NoScript::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + NoScript::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Fallback content') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Metadata/ScriptTest.php b/tests/Metadata/ScriptTest.php index 76e64cb..63d1618 100644 --- a/tests/Metadata/ScriptTest.php +++ b/tests/Metadata/ScriptTest.php @@ -134,34 +134,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Script::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Script::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -747,6 +719,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Script::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Script::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Metadata/StyleTest.php b/tests/Metadata/StyleTest.php index 7a26a3c..eb3ab1b 100644 --- a/tests/Metadata/StyleTest.php +++ b/tests/Metadata/StyleTest.php @@ -130,34 +130,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Style::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Style::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -631,6 +603,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Style::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Style::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Metadata/TemplateTest.php b/tests/Metadata/TemplateTest.php index aa939a3..5da1926 100644 --- a/tests/Metadata/TemplateTest.php +++ b/tests/Metadata/TemplateTest.php @@ -131,34 +131,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Template::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Template::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -576,6 +548,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Template::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Template::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithShadowRootClonable(): void { self::assertSame( diff --git a/tests/Metadata/TitleTest.php b/tests/Metadata/TitleTest.php index 0e7e5a9..b3fa921 100644 --- a/tests/Metadata/TitleTest.php +++ b/tests/Metadata/TitleTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Title::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Title::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -569,6 +541,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Title::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Title::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Palpable/ATest.php b/tests/Palpable/ATest.php index b8bdb27..6c1d938 100644 --- a/tests/Palpable/ATest.php +++ b/tests/Palpable/ATest.php @@ -125,32 +125,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - A::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - A::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Link content') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -574,6 +548,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + A::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + A::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Link content') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Phrasing/ITest.php b/tests/Phrasing/ITest.php index 9901ffe..c084174 100644 --- a/tests/Phrasing/ITest.php +++ b/tests/Phrasing/ITest.php @@ -117,32 +117,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - I::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - I::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Idiomatic text') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -436,6 +410,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + I::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + I::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Idiomatic text') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Phrasing/LabelTest.php b/tests/Phrasing/LabelTest.php index a2ecdbf..091cc78 100644 --- a/tests/Phrasing/LabelTest.php +++ b/tests/Phrasing/LabelTest.php @@ -117,32 +117,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - Label::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - Label::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Label content') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -449,6 +423,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + Label::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + Label::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Label content') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Phrasing/SpanTest.php b/tests/Phrasing/SpanTest.php index f514dc8..752d7e9 100644 --- a/tests/Phrasing/SpanTest.php +++ b/tests/Phrasing/SpanTest.php @@ -115,32 +115,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - HTML, - Span::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - HTML, - Span::tag() - ->setAttribute(GlobalAttribute::TITLE, 'Span content') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -434,6 +408,32 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + HTML, + Span::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + HTML, + Span::tag() + ->setAttribute(GlobalAttribute::TITLE, 'Span content') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithStyle(): void { self::assertSame( diff --git a/tests/Root/BodyTest.php b/tests/Root/BodyTest.php index 6093d2b..ea10900 100644 --- a/tests/Root/BodyTest.php +++ b/tests/Root/BodyTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Body::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Body::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Body::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Body::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Root/FooterTest.php b/tests/Root/FooterTest.php index 76e7b89..1aef3f6 100644 --- a/tests/Root/FooterTest.php +++ b/tests/Root/FooterTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Footer::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Footer::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Footer::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Footer::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Root/HeadTest.php b/tests/Root/HeadTest.php index b5f3c36..a467830 100644 --- a/tests/Root/HeadTest.php +++ b/tests/Root/HeadTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Head::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Head::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Head::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Head::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Root/HeaderTest.php b/tests/Root/HeaderTest.php index 11bfc8c..6e9a0aa 100644 --- a/tests/Root/HeaderTest.php +++ b/tests/Root/HeaderTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Header::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Header::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Header::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Header::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Root/HtmlTest.php b/tests/Root/HtmlTest.php index 11f2f83..2f7b721 100644 --- a/tests/Root/HtmlTest.php +++ b/tests/Root/HtmlTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Html::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Html::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Html::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Html::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Sectioning/ArticleTest.php b/tests/Sectioning/ArticleTest.php index c9a721a..4967c80 100644 --- a/tests/Sectioning/ArticleTest.php +++ b/tests/Sectioning/ArticleTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Article::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Article::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Article::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Article::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Sectioning/AsideTest.php b/tests/Sectioning/AsideTest.php index 2a08d49..7f4c7fe 100644 --- a/tests/Sectioning/AsideTest.php +++ b/tests/Sectioning/AsideTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Aside::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Aside::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Aside::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Aside::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Sectioning/NavTest.php b/tests/Sectioning/NavTest.php index 3779564..ef67fe8 100644 --- a/tests/Sectioning/NavTest.php +++ b/tests/Sectioning/NavTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Nav::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Nav::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Nav::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Nav::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame( diff --git a/tests/Sectioning/SectionTest.php b/tests/Sectioning/SectionTest.php index 078ba35..bcee112 100644 --- a/tests/Sectioning/SectionTest.php +++ b/tests/Sectioning/SectionTest.php @@ -124,34 +124,6 @@ public function testRenderWithAddAriaAttributeUsingEnum(): void ); } - public function testRenderWithAddAttribute(): void - { - self::assertSame( - << - - HTML, - Section::tag() - ->setAttribute('data-test', 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method.", - ); - } - - public function testRenderWithAddAttributeUsingEnum(): void - { - self::assertSame( - << - - HTML, - Section::tag() - ->setAttribute(GlobalAttribute::TITLE, 'value') - ->render(), - "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", - ); - } - public function testRenderWithAddDataAttribute(): void { self::assertSame( @@ -557,6 +529,34 @@ public function testRenderWithRoleUsingEnum(): void ); } + public function testRenderWithSetAttribute(): void + { + self::assertSame( + << + + HTML, + Section::tag() + ->setAttribute('data-test', 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method.", + ); + } + + public function testRenderWithSetAttributeUsingEnum(): void + { + self::assertSame( + << + + HTML, + Section::tag() + ->setAttribute(GlobalAttribute::TITLE, 'value') + ->render(), + "Failed asserting that element renders correctly with 'setAttribute()' method using enum.", + ); + } + public function testRenderWithSpellcheck(): void { self::assertSame(