@@ -25,7 +25,7 @@ test(function () {
2525 $ form = new Form ;
2626 $ input = $ form ->addText ('text ' , 'Label ' )
2727 ->setValue ('text ' )
28- ->setAttribute ('autocomplete ' , 'off ' );
28+ ->setHtmlAttribute ('autocomplete ' , 'off ' );
2929
3030 Assert::type (Html::class, $ input ->getLabel ());
3131 Assert::same ('<label for="frm-text">Label</label> ' , (string ) $ input ->getLabel ());
@@ -39,7 +39,7 @@ test(function () {
3939test (function () { // translator
4040 $ form = new Form ;
4141 $ input = $ form ->addText ('text ' , 'Label ' )
42- ->setAttribute ('placeholder ' , 'place ' )
42+ ->setHtmlAttribute ('placeholder ' , 'place ' )
4343 ->setValue ('text ' )
4444 ->setTranslator (new Translator )
4545 ->setEmptyValue ('xxx ' );
@@ -76,13 +76,13 @@ test(function () { // validation rule required & PATTERN
7676 ->addRule ($ form ::PATTERN , 'error message ' , '[0-9]+ ' );
7777
7878 foreach (['text ' , 'search ' , 'tel ' , 'url ' , 'email ' ] as $ type ) {
79- $ input ->setType ($ type );
79+ $ input ->setHtmlType ($ type );
8080 Assert::same ('<input type=" ' . $ type . '" name="text" pattern="[0-9]+" id="frm-text" required data-nette-rules= \'[{"op":":filled","msg":"required"},{"op":":pattern","msg":"error message","arg":"[0-9]+"}] \'> ' , (string ) $ input ->getControl ());
8181 }
82- $ input ->setType ('password ' );
82+ $ input ->setHtmlType ('password ' );
8383 Assert::same ('<input type="password" name="text" pattern="[0-9]+" id="frm-text" required data-nette-rules= \'[{"op":":filled","msg":"required"},{"op":":pattern","msg":"error message","arg":"[0-9]+"}] \'> ' , (string ) $ input ->getControl ());
8484
85- $ input ->setType ('number ' );
85+ $ input ->setHtmlType ('number ' );
8686 Assert::same ('<input type="number" name="text" pattern="[0-9]+" id="frm-text" required data-nette-rules= \'[{"op":":filled","msg":"required"},{"op":":pattern","msg":"error message","arg":"[0-9]+"}] \'> ' , (string ) $ input ->getControl ());
8787});
8888
@@ -125,7 +125,7 @@ test(function () { // validation rule MAX_LENGTH
125125});
126126
127127
128- test (function () { // validation rule RANGE without setType
128+ test (function () { // validation rule RANGE without setHtmlType
129129 $ form = new Form ;
130130 $ minInput = $ form ->addText ('min ' );
131131 $ maxInput = $ form ->addText ('max ' );
@@ -139,12 +139,12 @@ test(function () { // validation rule RANGE without setType
139139});
140140
141141
142- test (function () { // validation rule RANGE with setType
142+ test (function () { // validation rule RANGE with setHtmlType
143143 $ form = new Form ;
144144 $ minInput = $ form ->addText ('min ' );
145145 $ maxInput = $ form ->addText ('max ' );
146146 $ input = $ form ->addText ('count ' )
147- ->setType ('number ' )
147+ ->setHtmlType ('number ' )
148148 ->addRule (Form::RANGE , 'Must be in range from %d to %d ' , [0 , 100 ])
149149 ->addRule (Form::MIN , 'Must be greater than or equal to %d ' , 1 )
150150 ->addRule (Form::MAX , 'Must be less than or equal to %d ' , 101 )
0 commit comments