@@ -82,4 +82,49 @@ public function it_can_be_used_in_builder(): void
82
82
$ this ->assertArrayHasKey ('top1End ' , $ builder ->getAttributes ()['layout ' ]);
83
83
$ this ->assertArrayHasKey ('bottom1End ' , $ builder ->getAttributes ()['layout ' ]);
84
84
}
85
+
86
+ #[Test]
87
+ public function it_has_factory_method (): void
88
+ {
89
+ $ layout = Layout::make ();
90
+ $ this ->assertInstanceOf (Layout::class, $ layout );
91
+
92
+ $ builder = resolve (Builder::class);
93
+ $ builder ->layout (Layout::make ());
94
+
95
+ $ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
96
+ }
97
+
98
+ #[Test]
99
+ public function it_can_be_macroable (): void
100
+ {
101
+ Layout::macro ('test ' , fn () => 'test ' );
102
+
103
+ $ layout = new Layout ;
104
+ $ this ->assertEquals ('test ' , $ layout ->test ());
105
+ }
106
+
107
+ #[Test]
108
+ public function it_can_accept_array (): void
109
+ {
110
+ $ layout = new Layout (['top ' => 'test ' ]);
111
+ $ this ->assertEquals ('test ' , $ layout ->get ('top ' ));
112
+ }
113
+
114
+ #[Test]
115
+ public function it_can_accept_array_as_parameter (): void
116
+ {
117
+ $ layout = Layout::make (['top ' => 'test ' ]);
118
+ $ this ->assertEquals ('test ' , $ layout ->get ('top ' ));
119
+ }
120
+
121
+ #[Test]
122
+ public function it_can_accept_array_as_parameter_in_builder (): void
123
+ {
124
+ $ builder = resolve (Builder::class);
125
+ $ builder ->layout (['top ' => 'test ' ]);
126
+
127
+ $ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
128
+ $ this ->assertArrayHasKey ('top ' , $ builder ->getAttributes ()['layout ' ]);
129
+ }
85
130
}
0 commit comments