@@ -118,17 +118,47 @@ public function testShowOutput(): void
118118
119119 $ this ->assertMatchesRegularExpression (
120120 '~<input type="range" ' .
121- 'oninput="document.getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
121+ 'oninput="document\ .getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
122122 "\n" . '<span id="(?P=id)">-</span>~ ' ,
123123 $ tag ->render ()
124124 );
125125 }
126126
127+ public function testOutputAttributes (): void
128+ {
129+ $ tag = Range::tag ()
130+ ->showOutput ()
131+ ->outputAttributes (['class ' => 'red ' ])
132+ ->outputAttributes (['id ' => 'UID ' ]);
133+
134+ $ this ->assertSame (
135+ '<input type="range" ' .
136+ 'oninput="document.getElementById("UID").innerHTML=this.value"> ' .
137+ "\n" . '<span id="UID" class="red">-</span> ' ,
138+ $ tag ->render ()
139+ );
140+ }
141+
142+ public function testReplaceOutputAttributes (): void
143+ {
144+ $ tag = Range::tag ()
145+ ->showOutput ()
146+ ->outputAttributes (['class ' => 'red ' ])
147+ ->replaceOutputAttributes (['id ' => 'UID ' ]);
148+
149+ $ this ->assertSame (
150+ '<input type="range" ' .
151+ 'oninput="document.getElementById("UID").innerHTML=this.value"> ' .
152+ "\n" . '<span id="UID">-</span> ' ,
153+ $ tag ->render ()
154+ );
155+ }
156+
127157 public function testOutputWithCustomId (): void
128158 {
129159 $ tag = Range::tag ()
130160 ->showOutput ()
131- ->outputTagAttributes (['id ' => 'UID ' ]);
161+ ->outputAttributes (['id ' => 'UID ' ]);
132162
133163 $ this ->assertMatchesRegularExpression (
134164 '~<input type="range" ' .
@@ -138,29 +168,29 @@ public function testOutputWithCustomId(): void
138168 );
139169 }
140170
141- public function testOutputWithCustomTagName (): void
171+ public function testOutputWithCustomTag (): void
142172 {
143173 $ tag = Range::tag ()
144174 ->showOutput ()
145- ->outputTagName ('b ' );
175+ ->outputTag ('b ' );
146176
147177 $ this ->assertMatchesRegularExpression (
148178 '~<input type="range" ' .
149- 'oninput="document.getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
179+ 'oninput="document\ .getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
150180 "\n" . '<b id="(?P=id)">-</b>~ ' ,
151181 $ tag ->render ()
152182 );
153183 }
154184
155- public function testOutputWithCustomTagAttributes (): void
185+ public function testOutputWithCustomAttributes (): void
156186 {
157187 $ tag = Range::tag ()
158188 ->showOutput ()
159- ->outputTagAttributes (['class ' => 'red ' ]);
189+ ->outputAttributes (['class ' => 'red ' ]);
160190
161191 $ this ->assertMatchesRegularExpression (
162192 '~<input type="range" ' .
163- 'oninput="document.getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
193+ 'oninput="document\ .getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
164194 "\n" . '<span id="(?P=id)" class="red">-</span>~ ' ,
165195 $ tag ->render ()
166196 );
@@ -174,19 +204,19 @@ public function testOutputWithValue(): void
174204
175205 $ this ->assertMatchesRegularExpression (
176206 '~<input type="range" value="10" ' .
177- 'oninput="document.getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
207+ 'oninput="document\ .getElementById\(\"(?<id>rangeOutput\d*)\"\)\.innerHTML=this\.value"> ' .
178208 "\n" . '<span id="(?P=id)">10</span>~ ' ,
179209 $ tag ->render ()
180210 );
181211 }
182212
183- public function testEmptyOutputTagName (): void
213+ public function testEmptyOutputTag (): void
184214 {
185215 $ tag = Range::tag ();
186216
187217 $ this ->expectException (InvalidArgumentException::class);
188218 $ this ->expectExceptionMessage ('The output tag name it cannot be empty value. ' );
189- $ tag ->outputTagName ('' );
219+ $ tag ->outputTag ('' );
190220 }
191221
192222 public function testImmutability (): void
@@ -198,7 +228,8 @@ public function testImmutability(): void
198228 $ this ->assertNotSame ($ tag , $ tag ->step (null ));
199229 $ this ->assertNotSame ($ tag , $ tag ->list (null ));
200230 $ this ->assertNotSame ($ tag , $ tag ->showOutput ());
201- $ this ->assertNotSame ($ tag , $ tag ->outputTagName ('b ' ));
202- $ this ->assertNotSame ($ tag , $ tag ->outputTagAttributes ([]));
231+ $ this ->assertNotSame ($ tag , $ tag ->outputTag ('b ' ));
232+ $ this ->assertNotSame ($ tag , $ tag ->outputAttributes ([]));
233+ $ this ->assertNotSame ($ tag , $ tag ->replaceOutputAttributes ([]));
203234 }
204235}
0 commit comments