From ee4efc67113db2ee437ba153e414e69fce148829 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Wed, 9 Sep 2020 12:25:14 +0100 Subject: [PATCH] Starting Laravel v8 support + Updating the package Fixing doc comments --- .github/workflows/run-tests.yml | 8 +- .scrutinizer.yml | 2 +- composer.json | 20 ++- phpunit.xml.dist | 33 ++--- src/Contracts/Elements/HtmlElement.php | 5 +- src/Contracts/Html.php | 5 +- src/Contracts/Renderable.php | 5 +- src/Contracts/Selectable.php | 17 ++- src/Elements/A.php | 1 - src/Elements/Button.php | 36 ++--- src/Elements/Concerns/HasAttributes.php | 1 - .../Concerns/HasAutofocusAttribute.php | 35 +++++ src/Elements/Concerns/HasChildElements.php | 1 - .../Concerns/HasConditionalMethods.php | 2 - .../Concerns/HasDisabledAttribute.php | 34 +++++ .../Concerns/HasMinMaxLengthAttributes.php | 44 ++++++ src/Elements/Concerns/HasNameAttribute.php | 32 +++++ .../Concerns/HasPlaceholderAttribute.php | 32 +++++ .../Concerns/HasReadonlyAttribute.php | 29 ++++ .../Concerns/HasRequiredAttribute.php | 34 +++++ src/Elements/Concerns/HasTypeAttribute.php | 32 +++++ src/Elements/Concerns/HasValueAttribute.php | 32 +++++ src/Elements/Div.php | 1 - src/Elements/Dl.php | 1 - src/Elements/Element.php | 1 - src/Elements/Fieldset.php | 1 - src/Elements/File.php | 44 ++---- src/Elements/Form.php | 9 +- src/Elements/HtmlElement.php | 1 - src/Elements/I.php | 1 - src/Elements/Img.php | 1 - src/Elements/Input.php | 122 ++++------------ src/Elements/Label.php | 1 - src/Elements/Legend.php | 1 - src/Elements/Link.php | 3 - src/Elements/ListElement.php | 1 - src/Elements/Meta.php | 1 - src/Elements/Ol.php | 1 - src/Elements/Optgroup.php | 1 - src/Elements/Option.php | 46 +++--- src/Elements/Select.php | 42 +++--- src/Elements/Span.php | 1 - src/Elements/Textarea.php | 73 ++++------ src/Elements/Ul.php | 1 - src/Entities/Attributes.php | 1 - src/Entities/Attributes/AbstractAttribute.php | 1 - src/Entities/Attributes/ClassAttribute.php | 1 - src/Entities/Attributes/MiscAttribute.php | 1 - src/Entities/ChildrenCollection.php | 1 - src/Exceptions/InvalidChildException.php | 1 - src/Exceptions/InvalidHtmlException.php | 3 +- src/Exceptions/MissingTagException.php | 3 +- src/Exceptions/VoidElementException.php | 1 - src/Html.php | 77 +++++++--- tests/Concerns/AssertsHtmlStrings.php | 1 - tests/Elements/ATest.php | 1 - tests/Elements/ButtonTest.php | 4 +- tests/Elements/DivTest.php | 1 - tests/Elements/DlTest.php | 1 - tests/Elements/ElementTest.php | 4 +- tests/Elements/FieldsetTest.php | 1 - tests/Elements/FileTest.php | 19 ++- tests/Elements/FormTest.php | 24 +++- tests/Elements/HtmlElementTest.php | 1 - tests/Elements/ITest.php | 1 - tests/Elements/ImgTest.php | 1 - tests/Elements/InputTest.php | 37 ++++- tests/Elements/LabelTest.php | 1 - tests/Elements/LegendTest.php | 1 - tests/Elements/LinkTest.php | 1 - tests/Elements/MetaTest.php | 1 - tests/Elements/OlTest.php | 4 +- tests/Elements/OptgroupTest.php | 1 - tests/Elements/OptionTest.php | 1 - tests/Elements/SelectTest.php | 133 +++++++++++++++++- tests/Elements/SpanTest.php | 1 - tests/Elements/TestCase.php | 1 - tests/Elements/TextareaTest.php | 1 - tests/Elements/UlTest.php | 4 +- tests/Entities/AttributesTest.php | 1 - tests/Entities/ChildrenCollectionTest.php | 1 - tests/Entities/ClassAttributeTest.php | 1 - tests/Html/ATest.php | 1 - tests/Html/ButtonTest.php | 1 - tests/Html/CheckboxTest.php | 1 - tests/Html/ClassTest.php | 1 - tests/Html/DivTest.php | 1 - tests/Html/DlTest.php | 1 - tests/Html/ElementTest.php | 1 - tests/Html/EmailInputTest.php | 1 - tests/Html/FieldsetTest.php | 1 - tests/Html/FileTest.php | 1 - tests/Html/FormTest.php | 1 - tests/Html/ITest.php | 1 - tests/Html/ImgTest.php | 1 - tests/Html/InputTest.php | 91 +++++++++++- tests/Html/LabelTest.php | 1 - tests/Html/LegendTest.php | 1 - tests/Html/MailToTest.php | 1 - tests/Html/OlTest.php | 1 - tests/Html/OptionTest.php | 1 - tests/Html/PasswordTest.php | 1 - tests/Html/RadioTest.php | 1 - tests/Html/ResetTest.php | 1 - tests/Html/SelectTest.php | 1 - tests/Html/SpanTest.php | 1 - tests/Html/SubmitTest.php | 1 - tests/Html/TelTest.php | 1 - tests/Html/TestCase.php | 1 - tests/Html/TextareaTest.php | 1 - tests/Html/UlTest.php | 1 - tests/HtmlTest.php | 1 - tests/TestCase.php | 1 - 113 files changed, 829 insertions(+), 425 deletions(-) create mode 100644 src/Elements/Concerns/HasAutofocusAttribute.php create mode 100644 src/Elements/Concerns/HasDisabledAttribute.php create mode 100644 src/Elements/Concerns/HasMinMaxLengthAttributes.php create mode 100644 src/Elements/Concerns/HasNameAttribute.php create mode 100644 src/Elements/Concerns/HasPlaceholderAttribute.php create mode 100644 src/Elements/Concerns/HasReadonlyAttribute.php create mode 100644 src/Elements/Concerns/HasRequiredAttribute.php create mode 100644 src/Elements/Concerns/HasTypeAttribute.php create mode 100644 src/Elements/Concerns/HasValueAttribute.php diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8f4e42e..5b8e007 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,20 +9,20 @@ jobs: strategy: fail-fast: true matrix: - php: [7.2, 7.3, 7.4] + php: [7.3, 7.4] dependency-version: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ~/.composer/cache/files - key: dependencies-laravel-7.x-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + key: dependencies-laravel-8-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 8a9285f..69d4755 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -22,7 +22,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 6 + runs: 4 php_code_sniffer: enabled: true config: diff --git a/composer.json b/composer.json index 6d78656..ed92b5a 100644 --- a/composer.json +++ b/composer.json @@ -14,12 +14,12 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.2.5", - "illuminate/support": "^7.0" + "php": "^7.3", + "illuminate/support": "^8.0" }, "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.5|^9.0" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "autoload": { "psr-4": { @@ -31,6 +31,18 @@ "Arcanedev\\Html\\Tests\\": "tests/" } }, + "scripts": { + "test": "phpunit", + "coverage": "phpunit --coverage-html build/coverage/html" + }, + "extra": { + "branch-alias": { + "dev-develop": "5.x-dev" + } + }, + "config": { + "sort-packages": true + }, "minimum-stability": "dev", "prefer-stable": true } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e838c23..8985104 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,27 +1,22 @@ - +> - ./tests/ + ./tests - - - ./src/ - - - - - - - + + + ./src + + + + + + + diff --git a/src/Contracts/Elements/HtmlElement.php b/src/Contracts/Elements/HtmlElement.php index 5a6986d..01ea207 100644 --- a/src/Contracts/Elements/HtmlElement.php +++ b/src/Contracts/Elements/HtmlElement.php @@ -7,10 +7,9 @@ use Arcanedev\Html\Contracts\Renderable; /** - * Interface HtmlElement + * Interface HtmlElement * - * @package Arcanedev\Html\Contracts - * @author ARCANEDEV + * @author ARCANEDEV */ interface HtmlElement extends Renderable { diff --git a/src/Contracts/Html.php b/src/Contracts/Html.php index 34b5fd6..25eb4f1 100644 --- a/src/Contracts/Html.php +++ b/src/Contracts/Html.php @@ -5,10 +5,9 @@ namespace Arcanedev\Html\Contracts; /** - * Interface Html + * Interface Html * - * @package Arcanedev\Html\Contracts - * @author ARCANEDEV + * @author ARCANEDEV */ interface Html { diff --git a/src/Contracts/Renderable.php b/src/Contracts/Renderable.php index 4e4fab3..603ae2e 100644 --- a/src/Contracts/Renderable.php +++ b/src/Contracts/Renderable.php @@ -7,10 +7,9 @@ use Illuminate\Contracts\Support\Htmlable; /** - * Interface Renderable + * Interface Renderable * - * @package Arcanedev\Html\Contracts - * @author ARCANEDEV + * @author ARCANEDEV */ interface Renderable extends Htmlable { diff --git a/src/Contracts/Selectable.php b/src/Contracts/Selectable.php index 0a64087..78397eb 100644 --- a/src/Contracts/Selectable.php +++ b/src/Contracts/Selectable.php @@ -5,10 +5,9 @@ namespace Arcanedev\Html\Contracts; /** - * Interface Selectable + * Interface Selectable * - * @package Arcanedev\Html\Contracts - * @author ARCANEDEV + * @author ARCANEDEV */ interface Selectable { @@ -18,19 +17,23 @@ interface Selectable */ /** - * @return static + * Add the selected attribute. + * + * @param bool $selected + * + * @return $this */ - public function selected(); + public function selected(bool $selected = true); /** * @param bool $condition * - * @return static + * @return $this */ public function selectedIf($condition); /** - * @return static + * @return $this */ public function unselected(); } diff --git a/src/Elements/A.php b/src/Elements/A.php index ae9b61c..dd8af9e 100644 --- a/src/Elements/A.php +++ b/src/Elements/A.php @@ -7,7 +7,6 @@ /** * Class A * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class A extends HtmlElement diff --git a/src/Elements/Button.php b/src/Elements/Button.php index 7a90556..4f62bbb 100644 --- a/src/Elements/Button.php +++ b/src/Elements/Button.php @@ -4,14 +4,24 @@ namespace Arcanedev\Html\Elements; +use Arcanedev\Html\Elements\Concerns\{HasNameAttribute, HasTypeAttribute, HasValueAttribute}; + /** * Class Button * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Button extends HtmlElement { + /* ----------------------------------------------------------------- + | Traits + | ----------------------------------------------------------------- + */ + + use HasNameAttribute, + HasTypeAttribute, + HasValueAttribute; + /* ----------------------------------------------------------------- | Properties | ----------------------------------------------------------------- @@ -25,18 +35,6 @@ class Button extends HtmlElement | ----------------------------------------------------------------- */ - /** - * Set the type attribute. - * - * @param string $type - * - * @return static - */ - public function type($type) - { - return $this->attributeIf(in_array($type, ['button', 'submit', 'reset']), 'type', $type); - } - /** * Set as submit button. * @@ -56,16 +54,4 @@ public function reset() { return $this->type('reset'); } - - /** - * Set the value attribute. - * - * @param string $value - * - * @return static - */ - public function value($value) - { - return $this->attribute('value', $value); - } } diff --git a/src/Elements/Concerns/HasAttributes.php b/src/Elements/Concerns/HasAttributes.php index 4f7136f..02b7676 100644 --- a/src/Elements/Concerns/HasAttributes.php +++ b/src/Elements/Concerns/HasAttributes.php @@ -10,7 +10,6 @@ /** * Trait HasAttributes * - * @package Arcanedev\Html\Elements\Concerns * @author ARCANEDEV */ trait HasAttributes diff --git a/src/Elements/Concerns/HasAutofocusAttribute.php b/src/Elements/Concerns/HasAutofocusAttribute.php new file mode 100644 index 0000000..bae6572 --- /dev/null +++ b/src/Elements/Concerns/HasAutofocusAttribute.php @@ -0,0 +1,35 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasAutofocusAttribute +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the autofocus attribute. + * + * @param bool $autofocus + * + * @return $this + */ + public function autofocus($autofocus = true) + { + return $autofocus + ? $this->attribute('autofocus') + : $this->forgetAttribute('autofocus'); + } + +} diff --git a/src/Elements/Concerns/HasChildElements.php b/src/Elements/Concerns/HasChildElements.php index 23affe9..0d3d62e 100644 --- a/src/Elements/Concerns/HasChildElements.php +++ b/src/Elements/Concerns/HasChildElements.php @@ -11,7 +11,6 @@ /** * Trait HasChildElements * - * @package Arcanedev\Html\Elements\Concerns * @author ARCANEDEV */ trait HasChildElements diff --git a/src/Elements/Concerns/HasConditionalMethods.php b/src/Elements/Concerns/HasConditionalMethods.php index 7226229..3a10df1 100644 --- a/src/Elements/Concerns/HasConditionalMethods.php +++ b/src/Elements/Concerns/HasConditionalMethods.php @@ -9,7 +9,6 @@ /** * Trait HasConditionalMethods * - * @package Arcanedev\Html\Elements\Concerns * @author ARCANEDEV */ trait HasConditionalMethods @@ -107,7 +106,6 @@ protected function callConditionalMethod(string $conditions, string $method, arr case 'IfNotNull': return $this->ifNotNull($value, $callback); - default: return $this; } diff --git a/src/Elements/Concerns/HasDisabledAttribute.php b/src/Elements/Concerns/HasDisabledAttribute.php new file mode 100644 index 0000000..b70b619 --- /dev/null +++ b/src/Elements/Concerns/HasDisabledAttribute.php @@ -0,0 +1,34 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasDisabledAttribute +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the disabled attribute. + * + * @param bool $disabled + * + * @return $this + */ + public function disabled($disabled = true) + { + return $disabled + ? $this->attribute('disabled', 'disabled') + : $this->forgetAttribute('disabled'); + } +} diff --git a/src/Elements/Concerns/HasMinMaxLengthAttributes.php b/src/Elements/Concerns/HasMinMaxLengthAttributes.php new file mode 100644 index 0000000..87b6334 --- /dev/null +++ b/src/Elements/Concerns/HasMinMaxLengthAttributes.php @@ -0,0 +1,44 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasMinMaxLengthAttributes +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the `minlength` attribute. + * + * @param int $length + * + * @return $this + */ + public function minlength(int $length) + { + return $this->attribute('minlength', $length); + } + + /** + * Add the `maxlength` attribute. + * + * @param int $length + * + * @return $this + */ + public function maxlength(int $length) + { + return $this->attribute('maxlength', $length); + } +} diff --git a/src/Elements/Concerns/HasNameAttribute.php b/src/Elements/Concerns/HasNameAttribute.php new file mode 100644 index 0000000..e34f861 --- /dev/null +++ b/src/Elements/Concerns/HasNameAttribute.php @@ -0,0 +1,32 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasNameAttribute +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the name attribute. + * + * @param string $name + * + * @return $this + */ + public function name(string $name) + { + return $this->attribute('name', $name); + } +} diff --git a/src/Elements/Concerns/HasPlaceholderAttribute.php b/src/Elements/Concerns/HasPlaceholderAttribute.php new file mode 100644 index 0000000..59d5fe0 --- /dev/null +++ b/src/Elements/Concerns/HasPlaceholderAttribute.php @@ -0,0 +1,32 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasPlaceholderAttribute +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the placeholder attribute. + * + * @param string $placeholder + * + * @return $this + */ + public function placeholder(string $placeholder) + { + return $this->attribute('placeholder', $placeholder); + } +} diff --git a/src/Elements/Concerns/HasReadonlyAttribute.php b/src/Elements/Concerns/HasReadonlyAttribute.php new file mode 100644 index 0000000..8002e2d --- /dev/null +++ b/src/Elements/Concerns/HasReadonlyAttribute.php @@ -0,0 +1,29 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasReadonlyAttribute +{ + /** + * Add the readonly attribute. + * + * @param bool $readonly + * + * @return $this + */ + public function readonly(bool $readonly = true) + { + return $readonly + ? $this->attribute('readonly') + : $this->forgetAttribute('readonly'); + } +} diff --git a/src/Elements/Concerns/HasRequiredAttribute.php b/src/Elements/Concerns/HasRequiredAttribute.php new file mode 100644 index 0000000..798063a --- /dev/null +++ b/src/Elements/Concerns/HasRequiredAttribute.php @@ -0,0 +1,34 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasRequiredAttribute +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the required attribute. + * + * @param bool $required + * + * @return $this + */ + public function required($required = true) + { + return $required + ? $this->attribute('required') + : $this->forgetAttribute('required'); + } +} diff --git a/src/Elements/Concerns/HasTypeAttribute.php b/src/Elements/Concerns/HasTypeAttribute.php new file mode 100644 index 0000000..aafd82d --- /dev/null +++ b/src/Elements/Concerns/HasTypeAttribute.php @@ -0,0 +1,32 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasTypeAttribute +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the type attribute. + * + * @param string $type + * + * @return static + */ + public function type(string $type) + { + return $this->attribute('type', $type); + } +} diff --git a/src/Elements/Concerns/HasValueAttribute.php b/src/Elements/Concerns/HasValueAttribute.php new file mode 100644 index 0000000..415b2c6 --- /dev/null +++ b/src/Elements/Concerns/HasValueAttribute.php @@ -0,0 +1,32 @@ + + * + * @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes + */ +trait HasValueAttribute +{ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- + */ + + /** + * Add the value attribute. + * + * @param string|mixed|null $value + * + * @return $this + */ + public function value($value) + { + return $this->attribute('value', $value); + } +} diff --git a/src/Elements/Div.php b/src/Elements/Div.php index 0a85cd2..90cb705 100644 --- a/src/Elements/Div.php +++ b/src/Elements/Div.php @@ -7,7 +7,6 @@ /** * Class Div * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Div extends HtmlElement diff --git a/src/Elements/Dl.php b/src/Elements/Dl.php index efc2a9b..44e9bc7 100644 --- a/src/Elements/Dl.php +++ b/src/Elements/Dl.php @@ -9,7 +9,6 @@ /** * Class Dl * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Dl extends HtmlElement diff --git a/src/Elements/Element.php b/src/Elements/Element.php index fbc5f43..eec44dc 100644 --- a/src/Elements/Element.php +++ b/src/Elements/Element.php @@ -7,7 +7,6 @@ /** * Class Element * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Element extends HtmlElement diff --git a/src/Elements/Fieldset.php b/src/Elements/Fieldset.php index f1a065e..e0b69e4 100644 --- a/src/Elements/Fieldset.php +++ b/src/Elements/Fieldset.php @@ -7,7 +7,6 @@ /** * Class Fieldset * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Fieldset extends HtmlElement diff --git a/src/Elements/File.php b/src/Elements/File.php index d02c06b..ffdf757 100644 --- a/src/Elements/File.php +++ b/src/Elements/File.php @@ -4,10 +4,11 @@ namespace Arcanedev\Html\Elements; +use Arcanedev\Html\Elements\Concerns\{HasAutofocusAttribute, HasNameAttribute, HasRequiredAttribute}; + /** * Class File * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class File extends HtmlElement @@ -21,6 +22,15 @@ class File extends HtmlElement const ACCEPT_VIDEO = 'video/*'; const ACCEPT_IMAGE = 'image/*'; + /* ----------------------------------------------------------------- + | Traits + | ----------------------------------------------------------------- + */ + + use HasAutofocusAttribute, + HasNameAttribute, + HasRequiredAttribute; + /* ----------------------------------------------------------------- | Properties | ----------------------------------------------------------------- @@ -49,38 +59,6 @@ public function __construct() | ----------------------------------------------------------------- */ - /** - * Add the name attribute. - * - * @param string $name - * - * @return $this - */ - public function name($name) - { - return $this->attribute('name', $name); - } - - /** - * Add the required attribute. - * - * @return $this - */ - public function required() - { - return $this->attribute('required'); - } - - /** - * Add the required attribute. - * - * @return $this - */ - public function autofocus() - { - return $this->attribute('autofocus'); - } - /** * Add the accept attribute. * diff --git a/src/Elements/Form.php b/src/Elements/Form.php index abd216d..f460cd6 100644 --- a/src/Elements/Form.php +++ b/src/Elements/Form.php @@ -7,7 +7,6 @@ /** * Class Form * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Form extends HtmlElement @@ -54,11 +53,15 @@ public function method($method) /** * Add the novalidate attribute. * + * @param bool $novalidate + * * @return $this */ - public function novalidate() + public function novalidate(bool $novalidate = true) { - return $this->attribute('novalidate'); + return $novalidate + ? $this->attribute('novalidate') + : $this->forgetAttribute('novalidate'); } /** diff --git a/src/Elements/HtmlElement.php b/src/Elements/HtmlElement.php index d96fa90..2799c1b 100644 --- a/src/Elements/HtmlElement.php +++ b/src/Elements/HtmlElement.php @@ -12,7 +12,6 @@ /** * Class HtmlElement * - * @package Arcanedev\Html\Elements * @author ARCANEDEV * * @method \Arcanedev\Html\Elements\HtmlElement|mixed attributeIf(bool $condition, string $attribute, mixed $value = null) diff --git a/src/Elements/I.php b/src/Elements/I.php index 5a9df35..da3ded8 100644 --- a/src/Elements/I.php +++ b/src/Elements/I.php @@ -7,7 +7,6 @@ /** * Class I * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class I extends HtmlElement diff --git a/src/Elements/Img.php b/src/Elements/Img.php index e1498d3..0021298 100644 --- a/src/Elements/Img.php +++ b/src/Elements/Img.php @@ -7,7 +7,6 @@ /** * Class Img * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Img extends HtmlElement diff --git a/src/Elements/Input.php b/src/Elements/Input.php index 66c9b7b..c73e00c 100644 --- a/src/Elements/Input.php +++ b/src/Elements/Input.php @@ -4,14 +4,38 @@ namespace Arcanedev\Html\Elements; +use Arcanedev\Html\Elements\Concerns\HasAutofocusAttribute; +use Arcanedev\Html\Elements\Concerns\HasDisabledAttribute; +use Arcanedev\Html\Elements\Concerns\HasMinMaxLengthAttributes; +use Arcanedev\Html\Elements\Concerns\HasNameAttribute; +use Arcanedev\Html\Elements\Concerns\HasPlaceholderAttribute; +use Arcanedev\Html\Elements\Concerns\HasReadonlyAttribute; +use Arcanedev\Html\Elements\Concerns\HasRequiredAttribute; +use Arcanedev\Html\Elements\Concerns\HasTypeAttribute; +use Arcanedev\Html\Elements\Concerns\HasValueAttribute; + /** * Class Input * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Input extends HtmlElement { + /* ----------------------------------------------------------------- + | Traits + | ----------------------------------------------------------------- + */ + + use HasAutofocusAttribute, + HasDisabledAttribute, + HasMinMaxLengthAttributes, + HasNameAttribute, + HasPlaceholderAttribute, + HasReadonlyAttribute, + HasRequiredAttribute, + HasTypeAttribute, + HasValueAttribute; + /* ----------------------------------------------------------------- | Properties | ----------------------------------------------------------------- @@ -25,16 +49,6 @@ class Input extends HtmlElement | ----------------------------------------------------------------- */ - /** - * Set the autofocus attribute. - * - * @return $this - */ - public function autofocus() - { - return $this->attribute('autofocus'); - } - /** * Add the checked attribute. * @@ -62,90 +76,4 @@ public function unchecked() { return $this->checked(false); } - - /** - * Set the disabled attribute. - * - * @param bool $disabled - * - * @return $this - */ - public function disabled($disabled = true) - { - return $disabled - ? $this->attribute('disabled', 'disabled') - : $this->forgetAttribute('disabled'); - } - - /** - * Add the name attribute. - * - * @param string $name - * - * @return $this - */ - public function name($name) - { - return $this->attribute('name', $name); - } - - /** - * Add the placeholder attribute. - * - * @param string $placeholder - * - * @return $this - */ - public function placeholder($placeholder) - { - return $this->attribute('placeholder', $placeholder); - } - - /** - * Add the required attribute. - * - * @param bool $required - * - * @return $this - */ - public function required($required = true) - { - return $required - ? $this->attribute('required') - : $this->forgetAttribute('required'); - } - - /** - * Add the type attribute. - * - * @param string $type - * - * @return $this - */ - public function type($type) - { - return $this->attribute('type', $type); - } - - /** - * Add the value attribute. - * - * @param string $value - * - * @return $this - */ - public function value($value) - { - return $this->attribute('value', $value); - } - - /** - * Add the readonly attribute. - * - * @return $this - */ - public function readonly() - { - return $this->attribute('readonly'); - } } diff --git a/src/Elements/Label.php b/src/Elements/Label.php index 7c108b8..c1f8ce3 100644 --- a/src/Elements/Label.php +++ b/src/Elements/Label.php @@ -7,7 +7,6 @@ /** * Class Label * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Label extends HtmlElement diff --git a/src/Elements/Legend.php b/src/Elements/Legend.php index 675e0cb..edd1fc6 100644 --- a/src/Elements/Legend.php +++ b/src/Elements/Legend.php @@ -7,7 +7,6 @@ /** * Class Legend * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Legend extends HtmlElement diff --git a/src/Elements/Link.php b/src/Elements/Link.php index 0c5e827..951c4c8 100644 --- a/src/Elements/Link.php +++ b/src/Elements/Link.php @@ -7,10 +7,7 @@ /** * Class Link * - * @package Arcanedev\Html\Elements * @author ARCANEDEV - * - * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link */ class Link extends HtmlElement { diff --git a/src/Elements/ListElement.php b/src/Elements/ListElement.php index 2b35104..cdd1c4a 100644 --- a/src/Elements/ListElement.php +++ b/src/Elements/ListElement.php @@ -7,7 +7,6 @@ /** * Class ListElement * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ abstract class ListElement extends Element diff --git a/src/Elements/Meta.php b/src/Elements/Meta.php index b1be561..804bcf7 100644 --- a/src/Elements/Meta.php +++ b/src/Elements/Meta.php @@ -7,7 +7,6 @@ /** * Class Meta * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Meta extends HtmlElement diff --git a/src/Elements/Ol.php b/src/Elements/Ol.php index 8a982bf..26ad1bd 100644 --- a/src/Elements/Ol.php +++ b/src/Elements/Ol.php @@ -7,7 +7,6 @@ /** * Class Ol * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Ol extends ListElement diff --git a/src/Elements/Optgroup.php b/src/Elements/Optgroup.php index 6b2fd58..2c8f05e 100644 --- a/src/Elements/Optgroup.php +++ b/src/Elements/Optgroup.php @@ -7,7 +7,6 @@ /** * Class Optgroup * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Optgroup extends HtmlElement diff --git a/src/Elements/Option.php b/src/Elements/Option.php index 76afb70..171ef78 100644 --- a/src/Elements/Option.php +++ b/src/Elements/Option.php @@ -5,17 +5,25 @@ namespace Arcanedev\Html\Elements; use Arcanedev\Html\Contracts\Selectable; +use Arcanedev\Html\Elements\Concerns\{HasDisabledAttribute, HasValueAttribute}; /** * Class Option * - * @package Arcanedev\Html\Elements * @author ARCANEDEV * * @method \Arcanedev\Html\Elements\Option selectedUnless(bool $condition) */ class Option extends HtmlElement implements Selectable { + /* ----------------------------------------------------------------- + | Traits + | ----------------------------------------------------------------- + */ + + use HasDisabledAttribute, + HasValueAttribute; + /* ----------------------------------------------------------------- | Properties | ----------------------------------------------------------------- @@ -44,11 +52,15 @@ public function selectedIf($condition) /** * Add the selected attribute. * + * @param bool $selected + * * @return $this */ - public function selected() + public function selected(bool $selected = true) { - return $this->attribute('selected'); + return $selected + ? $this->attribute('selected') + : $this->forgetAttribute('selected'); } /** @@ -58,32 +70,6 @@ public function selected() */ public function unselected() { - return $this->forgetAttribute('selected'); - } - - /** - * Set the value. - * - * @param string $value - * - * @return $this - */ - public function value($value) - { - return $this->attribute('value', $value); - } - - /** - * Set the disabled attribute. - * - * @param bool $disabled - * - * @return $this - */ - public function disabled($disabled = true) - { - return $disabled - ? $this->attribute('disabled') - : $this->forgetAttribute('disabled'); + return $this->selected(false); } } diff --git a/src/Elements/Select.php b/src/Elements/Select.php index 8fd588f..d474037 100644 --- a/src/Elements/Select.php +++ b/src/Elements/Select.php @@ -5,17 +5,31 @@ namespace Arcanedev\Html\Elements; use Arcanedev\Html\Contracts\Selectable; -use Illuminate\Support\Collection; -use Illuminate\Support\Str; +use Arcanedev\Html\Elements\Concerns\HasAutofocusAttribute; +use Arcanedev\Html\Elements\Concerns\HasDisabledAttribute; +use Arcanedev\Html\Elements\Concerns\HasNameAttribute; +use Arcanedev\Html\Elements\Concerns\HasReadonlyAttribute; +use Arcanedev\Html\Elements\Concerns\HasRequiredAttribute; +use Illuminate\Support\{Collection, Str}; /** * Class Select * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Select extends HtmlElement { + /* ----------------------------------------------------------------- + | Traits + | ----------------------------------------------------------------- + */ + + use HasAutofocusAttribute, + HasDisabledAttribute, + HasNameAttribute, + HasRequiredAttribute, + HasReadonlyAttribute; + /* ----------------------------------------------------------------- | Properties | ----------------------------------------------------------------- @@ -51,18 +65,6 @@ public function multiple() })->applyValueToOptions(); } - /** - * Add the name attribute. - * - * @param string $name - * - * @return $this - */ - public function name($name) - { - return $this->attribute('name', $name); - } - /** * Add options. * @@ -99,16 +101,6 @@ public function placeholder($text, $value = null, $disabled = false) ); } - /** - * Add the required attribute. - * - * @return $this - */ - public function required() - { - return $this->attribute('required'); - } - /** * Set the value. * diff --git a/src/Elements/Span.php b/src/Elements/Span.php index 3f6753b..c42ef77 100644 --- a/src/Elements/Span.php +++ b/src/Elements/Span.php @@ -7,7 +7,6 @@ /** * Class Span * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Span extends HtmlElement diff --git a/src/Elements/Textarea.php b/src/Elements/Textarea.php index e744b34..1b506d6 100644 --- a/src/Elements/Textarea.php +++ b/src/Elements/Textarea.php @@ -4,72 +4,51 @@ namespace Arcanedev\Html\Elements; +use Arcanedev\Html\Elements\Concerns\HasAutofocusAttribute; +use Arcanedev\Html\Elements\Concerns\HasDisabledAttribute; +use Arcanedev\Html\Elements\Concerns\HasMinMaxLengthAttributes; +use Arcanedev\Html\Elements\Concerns\HasNameAttribute; +use Arcanedev\Html\Elements\Concerns\HasPlaceholderAttribute; +use Arcanedev\Html\Elements\Concerns\HasReadonlyAttribute; +use Arcanedev\Html\Elements\Concerns\HasRequiredAttribute; +use Arcanedev\Html\Elements\Concerns\HasValueAttribute; + /** * Class Textarea * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Textarea extends HtmlElement { /* ----------------------------------------------------------------- - | Properties + | Traits | ----------------------------------------------------------------- */ - protected $tag = 'textarea'; + use HasAutofocusAttribute, + HasDisabledAttribute, + HasMinMaxLengthAttributes, + HasNameAttribute, + HasPlaceholderAttribute, + HasReadonlyAttribute, + HasRequiredAttribute; /* ----------------------------------------------------------------- - | Main Methods + | Properties | ----------------------------------------------------------------- */ - /** - * Add the autofocus attribute. - * - * @return $this - */ - public function autofocus() - { - return $this->attribute('autofocus'); - } - - /** - * Add the placeholder attribute. - * - * @param string $placeholder - * - * @return $this - */ - public function placeholder($placeholder) - { - return $this->attribute('placeholder', $placeholder); - } + protected $tag = 'textarea'; - /** - * Add the name attribute. - * - * @param string $name - * - * @return $this + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ - public function name($name) - { - return $this->attribute('name', $name); - } /** - * Add the required attribute. + * Set the textarea value. * - * @return $this - */ - public function required() - { - return $this->attribute('required'); - } - - /** - * @param string $value + * @param string|null $value * * @return $this */ @@ -79,11 +58,13 @@ public function value($value) } /** + * Set the textarea cols & rows sizes. + * * @param string $size * * @return $this */ - public function size($size) + public function size(string $size) { list($cols, $rows) = explode('x', $size); diff --git a/src/Elements/Ul.php b/src/Elements/Ul.php index 89b0cb0..b38cb16 100644 --- a/src/Elements/Ul.php +++ b/src/Elements/Ul.php @@ -7,7 +7,6 @@ /** * Class Ul * - * @package Arcanedev\Html\Elements * @author ARCANEDEV */ class Ul extends ListElement diff --git a/src/Entities/Attributes.php b/src/Entities/Attributes.php index be13479..02e2d4d 100644 --- a/src/Entities/Attributes.php +++ b/src/Entities/Attributes.php @@ -11,7 +11,6 @@ /** * Class Attributes * - * @package Arcanedev\Html\Entities * @author ARCANEDEV */ class Attributes implements ArrayAccess, Arrayable diff --git a/src/Entities/Attributes/AbstractAttribute.php b/src/Entities/Attributes/AbstractAttribute.php index cd3ea73..e66a2ad 100644 --- a/src/Entities/Attributes/AbstractAttribute.php +++ b/src/Entities/Attributes/AbstractAttribute.php @@ -7,7 +7,6 @@ /** * Class AbstractAttribute * - * @package Arcanedev\Html\Entities\Attributes * @author ARCANEDEV */ abstract class AbstractAttribute diff --git a/src/Entities/Attributes/ClassAttribute.php b/src/Entities/Attributes/ClassAttribute.php index f5967c8..202395f 100644 --- a/src/Entities/Attributes/ClassAttribute.php +++ b/src/Entities/Attributes/ClassAttribute.php @@ -11,7 +11,6 @@ /** * Class ClassAttribute * - * @package Arcanedev\Html\Entities\Attributes * @author ARCANEDEV */ class ClassAttribute extends AbstractAttribute implements Countable diff --git a/src/Entities/Attributes/MiscAttribute.php b/src/Entities/Attributes/MiscAttribute.php index e773c56..36176a5 100644 --- a/src/Entities/Attributes/MiscAttribute.php +++ b/src/Entities/Attributes/MiscAttribute.php @@ -7,7 +7,6 @@ /** * Class MiscAttribute * - * @package Arcanedev\Html\Entities\Attributes * @author ARCANEDEV */ class MiscAttribute extends AbstractAttribute diff --git a/src/Entities/ChildrenCollection.php b/src/Entities/ChildrenCollection.php index 72cdffb..03d7617 100644 --- a/src/Entities/ChildrenCollection.php +++ b/src/Entities/ChildrenCollection.php @@ -13,7 +13,6 @@ /** * Class ChildrenCollection * - * @package Arcanedev\Html\Entities * @author ARCANEDEV */ class ChildrenCollection extends Collection implements Renderable diff --git a/src/Exceptions/InvalidChildException.php b/src/Exceptions/InvalidChildException.php index a1a756b..2720dd2 100644 --- a/src/Exceptions/InvalidChildException.php +++ b/src/Exceptions/InvalidChildException.php @@ -7,7 +7,6 @@ /** * Class InvalidChildException * - * @package Arcanedev\Html\Exceptions * @author ARCANEDEV */ class InvalidChildException extends \Exception diff --git a/src/Exceptions/InvalidHtmlException.php b/src/Exceptions/InvalidHtmlException.php index efe325f..ad76bb4 100644 --- a/src/Exceptions/InvalidHtmlException.php +++ b/src/Exceptions/InvalidHtmlException.php @@ -5,9 +5,8 @@ namespace Arcanedev\Html\Exceptions; /** - * Class InvalidHtml + * Class InvalidHtmlException * - * @package Arcanedev\Html\Exceptions * @author ARCANEDEV */ class InvalidHtmlException extends \Exception diff --git a/src/Exceptions/MissingTagException.php b/src/Exceptions/MissingTagException.php index 653522b..96f595e 100644 --- a/src/Exceptions/MissingTagException.php +++ b/src/Exceptions/MissingTagException.php @@ -5,9 +5,8 @@ namespace Arcanedev\Html\Exceptions; /** - * Class MissingTag + * Class MissingTagException * - * @package Arcanedev\Html\Exceptions * @author ARCANEDEV */ class MissingTagException extends \Exception diff --git a/src/Exceptions/VoidElementException.php b/src/Exceptions/VoidElementException.php index 14636b7..154c35b 100644 --- a/src/Exceptions/VoidElementException.php +++ b/src/Exceptions/VoidElementException.php @@ -7,7 +7,6 @@ /** * Class VoidElementException * - * @package Arcanedev\Html\Exceptions * @author ARCANEDEV */ class VoidElementException extends \Exception diff --git a/src/Html.php b/src/Html.php index a12ec6c..22fdb49 100644 --- a/src/Html.php +++ b/src/Html.php @@ -5,9 +5,24 @@ namespace Arcanedev\Html; use Arcanedev\Html\Contracts\Html as HtmlContract; -use Arcanedev\Html\Elements\{ - A, Button, Div, Dl, Element, Fieldset, File, Form, I, Img, Input, Label, Legend, Option, Select, Span, Textarea, Ul -}; +use Arcanedev\Html\Elements\A; +use Arcanedev\Html\Elements\Button; +use Arcanedev\Html\Elements\Div; +use Arcanedev\Html\Elements\Dl; +use Arcanedev\Html\Elements\Element; +use Arcanedev\Html\Elements\Fieldset; +use Arcanedev\Html\Elements\File; +use Arcanedev\Html\Elements\Form; +use Arcanedev\Html\Elements\I; +use Arcanedev\Html\Elements\Img; +use Arcanedev\Html\Elements\Input; +use Arcanedev\Html\Elements\Label; +use Arcanedev\Html\Elements\Legend; +use Arcanedev\Html\Elements\Option; +use Arcanedev\Html\Elements\Select; +use Arcanedev\Html\Elements\Span; +use Arcanedev\Html\Elements\Textarea; +use Arcanedev\Html\Elements\Ul; use Arcanedev\Html\Entities\Attributes\ClassAttribute; use DateTimeImmutable; use Illuminate\Support\Str; @@ -15,7 +30,6 @@ /** * Class Html * - * @package Arcanedev\Html * @author ARCANEDEV */ class Html implements HtmlContract @@ -108,14 +122,40 @@ public function date($name = null, $value = null, bool $format = true) $input = $this->input('date', $name, $value); if ( - $format - && $input->hasAttribute('value') - && ! empty($value = $input->getAttribute('value')->value()) + ! $format || + ! $input->hasAttribute('value') || + empty($value = $input->getAttribute('value')->value()) ) { - $input = $input->value(static::formatDateTime($value, static::HTML_DATE_FORMAT)); + return $input; } - return $input; + return $input->value(static::formatDateTime($value, static::HTML_DATE_FORMAT));; + } + + /** + * Make a datetime input. + * + * @param string|null $name + * @param string|null $value + * @param bool $format + * + * @return \Arcanedev\Html\Elements\Input + */ + public function datetime($name = null, $value = null, $format = true) + { + $input = $this->input('datetime-local', $name, $value); + + if ( + ! $format || + ! $input->hasAttribute('value') || + empty($value = $input->getAttribute('value')->value()) + ) { + return $input; + } + + return $input->value( + $this->formatDateTime($value, static::HTML_DATE_FORMAT.'\T'.static::HTML_TIME_FORMAT) + ); } /** @@ -481,11 +521,11 @@ public function time($name = null, $value = null, $format = true) /** * Make a number input. * - * @param string|null $name - * @param string|null $value - * @param mixed|null $min - * @param mixed|null $max - * @param mixed|null $step + * @param string|null $name + * @param string|null $value + * @param string|float|int|null $min + * @param string|float|int|null $max + * @param string|float|int|null $step * * @return \Arcanedev\Html\Elements\Input */ @@ -549,12 +589,13 @@ public function dl(array $attributes = []) protected static function formatDateTime(string $value, string $format): string { try { - return empty($value) - ? $value - : (new DateTimeImmutable($value))->format($format); + if ( ! empty($value)) + $value = (new DateTimeImmutable($value))->format($format); } catch (\Exception $e) { - return $value; + // Do nothing... } + + return $value; } } diff --git a/tests/Concerns/AssertsHtmlStrings.php b/tests/Concerns/AssertsHtmlStrings.php index 3edc8c0..c0577d9 100644 --- a/tests/Concerns/AssertsHtmlStrings.php +++ b/tests/Concerns/AssertsHtmlStrings.php @@ -10,7 +10,6 @@ /** * Trait AssertsHtmlStrings * - * @package Arcanedev\Html\Tests\Concerns * @author ARCANEDEV */ trait AssertsHtmlStrings diff --git a/tests/Elements/ATest.php b/tests/Elements/ATest.php index ac49e9c..a7d8f7d 100644 --- a/tests/Elements/ATest.php +++ b/tests/Elements/ATest.php @@ -9,7 +9,6 @@ /** * Class ATest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class ATest extends TestCase diff --git a/tests/Elements/ButtonTest.php b/tests/Elements/ButtonTest.php index aa9753d..79e6faf 100644 --- a/tests/Elements/ButtonTest.php +++ b/tests/Elements/ButtonTest.php @@ -4,13 +4,11 @@ namespace Arcanedev\Html\Tests\Elements; -use Arcanedev\Html\Elements\Button; -use Arcanedev\Html\Elements\I; +use Arcanedev\Html\Elements\{Button, I}; /** * Class ButtonTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class ButtonTest extends TestCase diff --git a/tests/Elements/DivTest.php b/tests/Elements/DivTest.php index 456fba6..a64fe99 100644 --- a/tests/Elements/DivTest.php +++ b/tests/Elements/DivTest.php @@ -9,7 +9,6 @@ /** * Class DivTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class DivTest extends TestCase diff --git a/tests/Elements/DlTest.php b/tests/Elements/DlTest.php index 814c4bf..1d8f1aa 100644 --- a/tests/Elements/DlTest.php +++ b/tests/Elements/DlTest.php @@ -9,7 +9,6 @@ /** * Class DlTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class DlTest extends TestCase diff --git a/tests/Elements/ElementTest.php b/tests/Elements/ElementTest.php index 8ab12f3..c4053ce 100644 --- a/tests/Elements/ElementTest.php +++ b/tests/Elements/ElementTest.php @@ -4,13 +4,11 @@ namespace Arcanedev\Html\Tests\Elements; -use Arcanedev\Html\Elements\Div; -use Arcanedev\Html\Elements\Element; +use Arcanedev\Html\Elements\{Div, Element}; /** * Class ElementTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class ElementTest extends TestCase diff --git a/tests/Elements/FieldsetTest.php b/tests/Elements/FieldsetTest.php index ac97817..dee7039 100644 --- a/tests/Elements/FieldsetTest.php +++ b/tests/Elements/FieldsetTest.php @@ -9,7 +9,6 @@ /** * Class FieldsetTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class FieldsetTest extends TestCase diff --git a/tests/Elements/FileTest.php b/tests/Elements/FileTest.php index 7e00a2f..6a2ff6d 100644 --- a/tests/Elements/FileTest.php +++ b/tests/Elements/FileTest.php @@ -9,7 +9,6 @@ /** * Class FileTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class FileTest extends TestCase @@ -37,6 +36,24 @@ public function it_can_create_with_autofocus_attribute(): void ); } + /** @test */ + public function it_can_create_with_autofocus_attribute_when_passing_true(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + File::make()->autofocus(true) + ); + } + + /** @test */ + public function it_wont_create_a_file_that_has_autofocus_when_passing_false(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + File::make()->autofocus(false) + ); + } + /** @test */ public function it_can_create_with_required_attribute(): void { diff --git a/tests/Elements/FormTest.php b/tests/Elements/FormTest.php index 6a8e81c..872450a 100644 --- a/tests/Elements/FormTest.php +++ b/tests/Elements/FormTest.php @@ -4,13 +4,11 @@ namespace Arcanedev\Html\Tests\Elements; -use Arcanedev\Html\Elements\Form; -use Arcanedev\Html\Elements\Input; +use Arcanedev\Html\Elements\{Form, Input}; /** * Class FormTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class FormTest extends TestCase @@ -80,7 +78,7 @@ public function it_can_create_with_html_builder(): void } /** @test */ - public function it_can_create_a_form_that_add_novalidate_attribute(): void + public function it_can_create_a_form_with_a_novalidate_attribute(): void { static::assertHtmlStringEqualsHtmlString( '
', @@ -88,6 +86,24 @@ public function it_can_create_a_form_that_add_novalidate_attribute(): void ); } + /** @test */ + public function it_can_create_a_form_that_has_novalidate_when_passing_true(): void + { + static::assertHtmlStringEqualsHtmlString( + '
', + Form::make()->novalidate(true)->acceptsFiles() + ); + } + + /** @test */ + public function it_wont_create_a_form_that_has_novalidate_when_passing_false(): void + { + static::assertHtmlStringEqualsHtmlString( + '
', + Form::make()->novalidate(false)->acceptsFiles() + ); + } + /** @test */ public function it_can_add_multiple_children_type_html_element(): void { diff --git a/tests/Elements/HtmlElementTest.php b/tests/Elements/HtmlElementTest.php index cb8f68c..2168781 100644 --- a/tests/Elements/HtmlElementTest.php +++ b/tests/Elements/HtmlElementTest.php @@ -9,7 +9,6 @@ /** * Class HtmlElementTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class HtmlElementTest extends TestCase diff --git a/tests/Elements/ITest.php b/tests/Elements/ITest.php index 751d720..d38e74f 100644 --- a/tests/Elements/ITest.php +++ b/tests/Elements/ITest.php @@ -9,7 +9,6 @@ /** * Class ITest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class ITest extends TestCase diff --git a/tests/Elements/ImgTest.php b/tests/Elements/ImgTest.php index f20adc6..577497c 100644 --- a/tests/Elements/ImgTest.php +++ b/tests/Elements/ImgTest.php @@ -9,7 +9,6 @@ /** * Class ImgTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class ImgTest extends TestCase diff --git a/tests/Elements/InputTest.php b/tests/Elements/InputTest.php index af8b973..110f8c1 100644 --- a/tests/Elements/InputTest.php +++ b/tests/Elements/InputTest.php @@ -9,7 +9,6 @@ /** * Class InputTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class InputTest extends TestCase @@ -100,6 +99,24 @@ public function it_can_create_that_has_autofocus(): void ); } + /** @test */ + public function it_can_create_an_input_that_has_autofocus_when_passing_true(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Input::make()->autofocus(true) + ); + } + + /** @test */ + public function it_wont_create_an_input_that_has_autofocus_when_passing_false(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Input::make()->autofocus(false) + ); + } + /** @test */ public function it_can_check(): void { @@ -186,4 +203,22 @@ public function it_can_create_a_button_input(): void Input::make()->type('button')->disabled() ); } + + /** @test */ + public function it_can_create_an_input_with_maxlength(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Input::make()->type('text')->maxlength(25) + ); + } + + /** @test */ + public function it_can_create_an_input_with_minlength(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Input::make()->type('text')->minlength(25) + ); + } } diff --git a/tests/Elements/LabelTest.php b/tests/Elements/LabelTest.php index c405a46..851e40b 100644 --- a/tests/Elements/LabelTest.php +++ b/tests/Elements/LabelTest.php @@ -9,7 +9,6 @@ /** * Class LabelTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class LabelTest extends TestCase diff --git a/tests/Elements/LegendTest.php b/tests/Elements/LegendTest.php index 4d86c12..3b9f44f 100644 --- a/tests/Elements/LegendTest.php +++ b/tests/Elements/LegendTest.php @@ -9,7 +9,6 @@ /** * Class LegendTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class LegendTest extends TestCase diff --git a/tests/Elements/LinkTest.php b/tests/Elements/LinkTest.php index 982b9a3..4f0c70d 100644 --- a/tests/Elements/LinkTest.php +++ b/tests/Elements/LinkTest.php @@ -9,7 +9,6 @@ /** * Class LinkTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class LinkTest extends TestCase diff --git a/tests/Elements/MetaTest.php b/tests/Elements/MetaTest.php index 1a74b01..e764c2b 100644 --- a/tests/Elements/MetaTest.php +++ b/tests/Elements/MetaTest.php @@ -9,7 +9,6 @@ /** * Class MetaTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class MetaTest extends TestCase diff --git a/tests/Elements/OlTest.php b/tests/Elements/OlTest.php index 2d7f0e8..f801dc4 100644 --- a/tests/Elements/OlTest.php +++ b/tests/Elements/OlTest.php @@ -4,13 +4,11 @@ namespace Arcanedev\Html\Tests\Elements; -use Arcanedev\Html\Elements\A; -use Arcanedev\Html\Elements\Ol; +use Arcanedev\Html\Elements\{A, Ol}; /** * Class OlTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class OlTest extends TestCase diff --git a/tests/Elements/OptgroupTest.php b/tests/Elements/OptgroupTest.php index 8a02bf4..fdc3ed4 100644 --- a/tests/Elements/OptgroupTest.php +++ b/tests/Elements/OptgroupTest.php @@ -9,7 +9,6 @@ /** * Class OptgroupTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class OptgroupTest extends TestCase diff --git a/tests/Elements/OptionTest.php b/tests/Elements/OptionTest.php index 225a260..a64d0b9 100644 --- a/tests/Elements/OptionTest.php +++ b/tests/Elements/OptionTest.php @@ -9,7 +9,6 @@ /** * Class OptionTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class OptionTest extends TestCase diff --git a/tests/Elements/SelectTest.php b/tests/Elements/SelectTest.php index 9c94254..19fca8f 100644 --- a/tests/Elements/SelectTest.php +++ b/tests/Elements/SelectTest.php @@ -9,7 +9,6 @@ /** * Class SelectTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class SelectTest extends TestCase @@ -313,4 +312,136 @@ public function it_can_render_a_select_element_with_options_with_a_selected_valu ->value('+2') ); } + + /** @test */ + public function it_can_create_a_disabled_select(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->disabled()->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_can_create_a_select_that_is_disabled_when_passing_true(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->disabled(true)->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_wont_create_a_select_that_is_disabled_when_passing_false(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->disabled(false)->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_can_create_a_select_that_has_autofocus(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->autofocus()->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_can_create_a_select_that_has_autofocus_when_passing_true(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->autofocus(true)->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_wont_create_a_select_that_has_autofocus_when_passing_false(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->autofocus(false)->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_can_create_a_select_that_is_required(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->required()->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_can_create_a_select_that_is_required_when_passing_true(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->required(true)->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_wont_create_a_select_that_is_required_when_passing_false(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->required(false)->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_can_create_a_select_that_is_readonly(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->readonly()->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_can_create_a_select_that_is_readonly_when_passing_true(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->readonly(true)->options(['value1' => 'text1'])->render() + ); + } + + /** @test */ + public function it_wont_create_a_select_that_is_readonly_when_passing_false(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + Select::make()->readonly(false)->options(['value1' => 'text1'])->render() + ); + } } diff --git a/tests/Elements/SpanTest.php b/tests/Elements/SpanTest.php index 566606a..a490a24 100644 --- a/tests/Elements/SpanTest.php +++ b/tests/Elements/SpanTest.php @@ -9,7 +9,6 @@ /** * Class SpanTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class SpanTest extends TestCase diff --git a/tests/Elements/TestCase.php b/tests/Elements/TestCase.php index 32e3fde..2b6f456 100644 --- a/tests/Elements/TestCase.php +++ b/tests/Elements/TestCase.php @@ -9,7 +9,6 @@ /** * Class TestCase * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ abstract class TestCase extends BaseTestCase diff --git a/tests/Elements/TextareaTest.php b/tests/Elements/TextareaTest.php index b0d1455..5cd8bfc 100644 --- a/tests/Elements/TextareaTest.php +++ b/tests/Elements/TextareaTest.php @@ -9,7 +9,6 @@ /** * Class TextareaTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class TextareaTest extends TestCase diff --git a/tests/Elements/UlTest.php b/tests/Elements/UlTest.php index d530d6b..86ae941 100644 --- a/tests/Elements/UlTest.php +++ b/tests/Elements/UlTest.php @@ -4,13 +4,11 @@ namespace Arcanedev\Html\Tests\Elements; -use Arcanedev\Html\Elements\A; -use Arcanedev\Html\Elements\Ul; +use Arcanedev\Html\Elements\{A, Ul}; /** * Class UlTest * - * @package Arcanedev\Html\Tests\Elements * @author ARCANEDEV */ class UlTest extends TestCase diff --git a/tests/Entities/AttributesTest.php b/tests/Entities/AttributesTest.php index d1ab86b..1a2190f 100644 --- a/tests/Entities/AttributesTest.php +++ b/tests/Entities/AttributesTest.php @@ -10,7 +10,6 @@ /** * Class AttributesTest * - * @package Arcanedev\Html\Tests\Entities * @author ARCANEDEV */ class AttributesTest extends TestCase diff --git a/tests/Entities/ChildrenCollectionTest.php b/tests/Entities/ChildrenCollectionTest.php index 280a128..ce058eb 100644 --- a/tests/Entities/ChildrenCollectionTest.php +++ b/tests/Entities/ChildrenCollectionTest.php @@ -11,7 +11,6 @@ /** * Class ChildrenCollectionTest * - * @package Arcanedev\Html\Tests\Entities * @author ARCANEDEV */ class ChildrenCollectionTest extends TestCase diff --git a/tests/Entities/ClassAttributeTest.php b/tests/Entities/ClassAttributeTest.php index ce658c4..bca9d97 100644 --- a/tests/Entities/ClassAttributeTest.php +++ b/tests/Entities/ClassAttributeTest.php @@ -10,7 +10,6 @@ /** * Class ClassAttributeTest * - * @package Arcanedev\Html\Tests\Entities * @author ARCANEDEV */ class ClassAttributeTest extends TestCase diff --git a/tests/Html/ATest.php b/tests/Html/ATest.php index 179c452..e06b271 100644 --- a/tests/Html/ATest.php +++ b/tests/Html/ATest.php @@ -7,7 +7,6 @@ /** * Class ATest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class ATest extends TestCase diff --git a/tests/Html/ButtonTest.php b/tests/Html/ButtonTest.php index c4bf44e..4ed0c86 100644 --- a/tests/Html/ButtonTest.php +++ b/tests/Html/ButtonTest.php @@ -7,7 +7,6 @@ /** * Class ButtonTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class ButtonTest extends TestCase diff --git a/tests/Html/CheckboxTest.php b/tests/Html/CheckboxTest.php index 7826559..beb155c 100644 --- a/tests/Html/CheckboxTest.php +++ b/tests/Html/CheckboxTest.php @@ -7,7 +7,6 @@ /** * Class CheckboxTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class CheckboxTest extends TestCase diff --git a/tests/Html/ClassTest.php b/tests/Html/ClassTest.php index 1fece8a..16ede3e 100644 --- a/tests/Html/ClassTest.php +++ b/tests/Html/ClassTest.php @@ -7,7 +7,6 @@ /** * Class ClassTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class ClassTest extends TestCase diff --git a/tests/Html/DivTest.php b/tests/Html/DivTest.php index 9ef639d..a5894e6 100644 --- a/tests/Html/DivTest.php +++ b/tests/Html/DivTest.php @@ -7,7 +7,6 @@ /** * Class DivTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class DivTest extends TestCase diff --git a/tests/Html/DlTest.php b/tests/Html/DlTest.php index e32e92a..8450491 100644 --- a/tests/Html/DlTest.php +++ b/tests/Html/DlTest.php @@ -7,7 +7,6 @@ /** * Class DlTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class DlTest extends TestCase diff --git a/tests/Html/ElementTest.php b/tests/Html/ElementTest.php index 1ff3445..294c953 100644 --- a/tests/Html/ElementTest.php +++ b/tests/Html/ElementTest.php @@ -9,7 +9,6 @@ /** * Class ElementTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class ElementTest extends TestCase diff --git a/tests/Html/EmailInputTest.php b/tests/Html/EmailInputTest.php index 8558ccc..80c344d 100644 --- a/tests/Html/EmailInputTest.php +++ b/tests/Html/EmailInputTest.php @@ -7,7 +7,6 @@ /** * Class EmailInputTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class EmailInputTest extends TestCase diff --git a/tests/Html/FieldsetTest.php b/tests/Html/FieldsetTest.php index 2b21b55..c796a01 100644 --- a/tests/Html/FieldsetTest.php +++ b/tests/Html/FieldsetTest.php @@ -7,7 +7,6 @@ /** * Class FieldsetTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class FieldsetTest extends TestCase diff --git a/tests/Html/FileTest.php b/tests/Html/FileTest.php index 890cb2d..e81f128 100644 --- a/tests/Html/FileTest.php +++ b/tests/Html/FileTest.php @@ -7,7 +7,6 @@ /** * Class FileTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class FileTest extends TestCase diff --git a/tests/Html/FormTest.php b/tests/Html/FormTest.php index 998b8c9..1fcf395 100644 --- a/tests/Html/FormTest.php +++ b/tests/Html/FormTest.php @@ -7,7 +7,6 @@ /** * Class FormTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class FormTest extends TestCase diff --git a/tests/Html/ITest.php b/tests/Html/ITest.php index b8d3577..63b47b3 100644 --- a/tests/Html/ITest.php +++ b/tests/Html/ITest.php @@ -7,7 +7,6 @@ /** * Class ITest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class ITest extends TestCase diff --git a/tests/Html/ImgTest.php b/tests/Html/ImgTest.php index 39832bf..56e0d26 100644 --- a/tests/Html/ImgTest.php +++ b/tests/Html/ImgTest.php @@ -7,7 +7,6 @@ /** * Class ImgTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class ImgTest extends TestCase diff --git a/tests/Html/InputTest.php b/tests/Html/InputTest.php index 6b811f1..fb40da2 100644 --- a/tests/Html/InputTest.php +++ b/tests/Html/InputTest.php @@ -7,7 +7,6 @@ /** * Class InputTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class InputTest extends TestCase @@ -136,6 +135,24 @@ public function it_can_make_an_input_that_is_readonly(): void ); } + /** @test */ + public function it_can_create_an_input_without_readonly(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->input()->readonly(false) + ); + } + + /** @test */ + public function it_can_remove_readonly_from_a_readonly_input(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->input()->readonly()->readonly(false) + ); + } + /** @test */ public function it_can_make_a_date_input(): void { @@ -172,6 +189,42 @@ public function it_can_make_a_date_input_with_invalid_date(): void ); } + /** @test */ + public function it_can_create_a_datetime_input(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->datetime() + ); + } + + /** @test */ + public function it_can_create_a_datetime_input_with_blank_date(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->datetime('test_datetime', '') + ); + } + + /** @test */ + public function it_can_create_a_datetime_input_and_format_date(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->datetime('test_datetime', '2020-01-20T15:00:12') + ); + } + + /** @test */ + public function it_can_create_a_datetime_input_with_invalid_date(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->datetime('test_datetime', 'notadate') + ); + } + /** @test */ public function it_can_make_a_time_input(): void { @@ -268,6 +321,42 @@ public function it_can_make_a_number_input_with_min_max_step(): void ); } + /** @test */ + public function it_can_create_a_number_input(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->number() + ); + } + + /** @test */ + public function it_can_create_a_number_input_with_min_max(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->number('test', '0', '0', '100') + ); + } + + /** @test */ + public function it_can_create_a_number_input_with_min_max_step(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->number('test', '0', '0', '100', '10') + ); + } + + /** @test */ + public function it_can_create_a_number_input_with_max_step(): void + { + static::assertHtmlStringEqualsHtmlString( + '', + $this->html->number('test', '30', null, '100', '10') + ); + } + /** @test */ public function it_avoids_fill_value_for_password_input(): void { diff --git a/tests/Html/LabelTest.php b/tests/Html/LabelTest.php index 0c81c26..3a284b1 100644 --- a/tests/Html/LabelTest.php +++ b/tests/Html/LabelTest.php @@ -7,7 +7,6 @@ /** * Class LabelTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class LabelTest extends TestCase diff --git a/tests/Html/LegendTest.php b/tests/Html/LegendTest.php index 71854f9..dd09d41 100644 --- a/tests/Html/LegendTest.php +++ b/tests/Html/LegendTest.php @@ -7,7 +7,6 @@ /** * Class LegendTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class LegendTest extends TestCase diff --git a/tests/Html/MailToTest.php b/tests/Html/MailToTest.php index f313537..4beaf01 100644 --- a/tests/Html/MailToTest.php +++ b/tests/Html/MailToTest.php @@ -7,7 +7,6 @@ /** * Class MailToTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class MailToTest extends TestCase diff --git a/tests/Html/OlTest.php b/tests/Html/OlTest.php index c53044d..deec346 100644 --- a/tests/Html/OlTest.php +++ b/tests/Html/OlTest.php @@ -7,7 +7,6 @@ /** * Class OlTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class OlTest extends TestCase diff --git a/tests/Html/OptionTest.php b/tests/Html/OptionTest.php index f08c096..8369121 100644 --- a/tests/Html/OptionTest.php +++ b/tests/Html/OptionTest.php @@ -7,7 +7,6 @@ /** * Class OptionTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class OptionTest extends TestCase diff --git a/tests/Html/PasswordTest.php b/tests/Html/PasswordTest.php index ccf6914..6ef47cc 100644 --- a/tests/Html/PasswordTest.php +++ b/tests/Html/PasswordTest.php @@ -7,7 +7,6 @@ /** * Class PasswordTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class PasswordTest extends TestCase diff --git a/tests/Html/RadioTest.php b/tests/Html/RadioTest.php index e2ebf4a..23fb89e 100644 --- a/tests/Html/RadioTest.php +++ b/tests/Html/RadioTest.php @@ -7,7 +7,6 @@ /** * Class RadioTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class RadioTest extends TestCase diff --git a/tests/Html/ResetTest.php b/tests/Html/ResetTest.php index 9c3d5f1..de1335c 100644 --- a/tests/Html/ResetTest.php +++ b/tests/Html/ResetTest.php @@ -7,7 +7,6 @@ /** * Class ResetTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class ResetTest extends TestCase diff --git a/tests/Html/SelectTest.php b/tests/Html/SelectTest.php index eee504d..ee52624 100644 --- a/tests/Html/SelectTest.php +++ b/tests/Html/SelectTest.php @@ -7,7 +7,6 @@ /** * Class SelectTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class SelectTest extends TestCase diff --git a/tests/Html/SpanTest.php b/tests/Html/SpanTest.php index c9d5407..89347c8 100644 --- a/tests/Html/SpanTest.php +++ b/tests/Html/SpanTest.php @@ -7,7 +7,6 @@ /** * Class SpanTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class SpanTest extends TestCase diff --git a/tests/Html/SubmitTest.php b/tests/Html/SubmitTest.php index cb59720..ef4e597 100644 --- a/tests/Html/SubmitTest.php +++ b/tests/Html/SubmitTest.php @@ -7,7 +7,6 @@ /** * Class SubmitTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class SubmitTest extends TestCase diff --git a/tests/Html/TelTest.php b/tests/Html/TelTest.php index c4d26ee..9689850 100644 --- a/tests/Html/TelTest.php +++ b/tests/Html/TelTest.php @@ -7,7 +7,6 @@ /** * Class TelTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class TelTest extends TestCase diff --git a/tests/Html/TestCase.php b/tests/Html/TestCase.php index 47f407b..bfcd356 100644 --- a/tests/Html/TestCase.php +++ b/tests/Html/TestCase.php @@ -10,7 +10,6 @@ /** * Class TestCase * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ abstract class TestCase extends BaseTestCase diff --git a/tests/Html/TextareaTest.php b/tests/Html/TextareaTest.php index 7e36a27..b1740a8 100644 --- a/tests/Html/TextareaTest.php +++ b/tests/Html/TextareaTest.php @@ -7,7 +7,6 @@ /** * Class TextareaTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class TextareaTest extends TestCase diff --git a/tests/Html/UlTest.php b/tests/Html/UlTest.php index 11c3ec8..1fc4b05 100644 --- a/tests/Html/UlTest.php +++ b/tests/Html/UlTest.php @@ -7,7 +7,6 @@ /** * Class UlTest * - * @package Arcanedev\Html\Tests\Html * @author ARCANEDEV */ class UlTest extends TestCase diff --git a/tests/HtmlTest.php b/tests/HtmlTest.php index ac0b290..dac7c47 100644 --- a/tests/HtmlTest.php +++ b/tests/HtmlTest.php @@ -9,7 +9,6 @@ /** * Class HtmlTest * - * @package Arcanedev\Html\Tests * @author ARCANEDEV */ class HtmlTest extends TestCase diff --git a/tests/TestCase.php b/tests/TestCase.php index 340dbca..540c0d1 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -10,7 +10,6 @@ /** * Class TestCase * - * @package Arcanedev\Html\Tests * @author ARCANEDEV */ abstract class TestCase extends BaseTestCase