@@ -71,7 +71,7 @@ public function testAttributesMerge(): void
7171 '<test id="color" class="green"> ' ,
7272 TestTag::tag ()
7373 ->id ('color ' )
74- ->class ('red ' )
74+ ->replaceClass ('red ' )
7575 ->attributes (['class ' => 'green ' ])
7676 ->render (),
7777 );
@@ -83,7 +83,7 @@ public function testReplaceAttributes(): void
8383 '<test class="green"> ' ,
8484 TestTag::tag ()
8585 ->id ('color ' )
86- ->class ('red ' )
86+ ->replaceClass ('red ' )
8787 ->replaceAttributes (['class ' => 'green ' ])
8888 ->render (),
8989 );
@@ -94,7 +94,7 @@ public function testUnionAttributes(): void
9494 $ this ->assertSame (
9595 '<test id="color" class="red"> ' ,
9696 TestTag::tag ()
97- ->class ('red ' )
97+ ->replaceClass ('red ' )
9898 ->unionAttributes (['class ' => 'green ' , 'id ' => 'color ' ])
9999 ->render (),
100100 );
@@ -151,11 +151,11 @@ public function dataClass(): array
151151 *
152152 * @param string[] $class
153153 */
154- public function testClass (string $ expected , array $ class ): void
154+ public function testAddClass (string $ expected , array $ class ): void
155155 {
156156 $ this ->assertSame ($ expected , (string )TestTag::tag ()
157- ->class ('main ' )
158- ->class (...$ class ));
157+ ->addClass ('main ' )
158+ ->addClass (...$ class ));
159159 }
160160
161161 public function dataNewClass (): array
@@ -172,7 +172,7 @@ public function dataNewClass(): array
172172 */
173173 public function testNewClass (string $ expected , ?string $ class ): void
174174 {
175- $ this ->assertSame ($ expected , (string )TestTag::tag ()->class ($ class ));
175+ $ this ->assertSame ($ expected , (string )TestTag::tag ()->addClass ($ class ));
176176 }
177177
178178 public function dataReplaceClass (): array
@@ -195,7 +195,7 @@ public function dataReplaceClass(): array
195195 public function testReplaceClass (string $ expected , array $ class ): void
196196 {
197197 $ this ->assertSame ($ expected , (string )TestTag::tag ()
198- ->class ('red ' )
198+ ->replaceClass ('red ' )
199199 ->replaceClass (...$ class ));
200200 }
201201
@@ -208,6 +208,7 @@ public function testImmutability(): void
208208 $ this ->assertNotSame ($ tag , $ tag ->attribute ('id ' , null ));
209209 $ this ->assertNotSame ($ tag , $ tag ->id (null ));
210210 $ this ->assertNotSame ($ tag , $ tag ->class ('test ' ));
211+ $ this ->assertNotSame ($ tag , $ tag ->addClass ('test ' ));
211212 $ this ->assertNotSame ($ tag , $ tag ->replaceClass ('test ' ));
212213 }
213214}
0 commit comments