File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33## 3.9.1 under development
44
55- Bug #232 : Render ` loading ` attribute before ` src ` (@samdark )
6+ - Enh #223 : Make ` $content ` parameter optional in ` Button ` factories (@FrankiFixx )
67
78## 3.9.0 November 29, 2024
89
Original file line number Diff line number Diff line change @@ -14,21 +14,21 @@ final class Button extends NormalTag
1414{
1515 use TagContentTrait;
1616
17- public static function button (string $ content ): self
17+ public static function button (string $ content = '' ): self
1818 {
1919 $ button = self ::tag ()->content ($ content );
2020 $ button ->attributes ['type ' ] = 'button ' ;
2121 return $ button ;
2222 }
2323
24- public static function submit (string $ content ): self
24+ public static function submit (string $ content = '' ): self
2525 {
2626 $ button = self ::tag ()->content ($ content );
2727 $ button ->attributes ['type ' ] = 'submit ' ;
2828 return $ button ;
2929 }
3030
31- public static function reset (string $ content ): self
31+ public static function reset (string $ content = '' ): self
3232 {
3333 $ button = self ::tag ()->content ($ content );
3434 $ button ->attributes ['type ' ] = 'reset ' ;
Original file line number Diff line number Diff line change @@ -28,6 +28,30 @@ public function testButton(): void
2828 );
2929 }
3030
31+ public function testButtonWithoutContent (): void
32+ {
33+ $ this ->assertSame (
34+ '<button type="button"></button> ' ,
35+ (string )Button::button ()
36+ );
37+ }
38+
39+ public function testSubmitWithoutContent (): void
40+ {
41+ $ this ->assertSame (
42+ '<button type="submit"></button> ' ,
43+ (string )Button::submit ()
44+ );
45+ }
46+
47+ public function testResetWithoutContent (): void
48+ {
49+ $ this ->assertSame (
50+ '<button type="reset"></button> ' ,
51+ (string )Button::reset ()
52+ );
53+ }
54+
3155 public function testSubmit (): void
3256 {
3357 $ this ->assertSame (
You can’t perform that action at this time.
0 commit comments