44
55use PHPUnit \Framework \Attributes \Test ;
66use Yajra \DataTables \Html \Builder ;
7+ use Yajra \DataTables \Html \Enums \LayoutPosition ;
78use Yajra \DataTables \Html \Layout ;
89
910class LayoutTest extends TestCase
@@ -36,16 +37,16 @@ public function it_can_set_positions(): void
3637 $ layout ->bottom ('test ' , 1 );
3738 $ this ->assertEquals ('test ' , $ layout ->get ('bottom1 ' ));
3839
39- $ layout ->top ('test ' , 1 , ' Start ' );
40+ $ layout ->top ('test ' , 1 , LayoutPosition:: Start);
4041 $ this ->assertEquals ('test ' , $ layout ->get ('top1Start ' ));
4142
42- $ layout ->bottom ('test ' , 1 , ' Start ' );
43+ $ layout ->bottom ('test ' , 1 , LayoutPosition:: Start);
4344 $ this ->assertEquals ('test ' , $ layout ->get ('bottom1Start ' ));
4445
45- $ layout ->top ('test ' , 1 , ' End ' );
46+ $ layout ->top ('test ' , 1 , LayoutPosition:: End);
4647 $ this ->assertEquals ('test ' , $ layout ->get ('top1End ' ));
4748
48- $ layout ->bottom ('test ' , 1 , ' End ' );
49+ $ layout ->bottom ('test ' , 1 , LayoutPosition:: End);
4950 $ this ->assertEquals ('test ' , $ layout ->get ('bottom1End ' ));
5051 }
5152
@@ -62,10 +63,10 @@ public function it_can_be_used_in_builder(): void
6263 $ layout ->bottomEnd ('test ' );
6364 $ layout ->top ('test ' , 1 );
6465 $ layout ->bottom ('test ' , 1 );
65- $ layout ->top ('test ' , 1 , ' Start ' );
66- $ layout ->bottom ('test ' , 1 , ' Start ' );
67- $ layout ->top ('test ' , 1 , ' End ' );
68- $ layout ->bottom ('test ' , 1 , ' End ' );
66+ $ layout ->top ('test ' , 1 , LayoutPosition:: Start);
67+ $ layout ->bottom ('test ' , 1 , LayoutPosition:: Start);
68+ $ layout ->top ('test ' , 1 , LayoutPosition:: End);
69+ $ layout ->bottom ('test ' , 1 , LayoutPosition:: End);
6970 });
7071
7172 $ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
@@ -156,7 +157,8 @@ public function it_can_accept_js_selector_for_layout_content(): void
156157 $ builder ->layout (fn (Layout $ layout ) => $ layout ->topStartView ('#test ' ));
157158 $ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
158159 $ this ->assertArrayHasKey ('topStart ' , $ builder ->getAttributes ()['layout ' ]);
159- $ this ->assertEquals ("function() { return $('#test').html(); } " , $ builder ->getAttributes ()['layout ' ]['topStart ' ]);
160+ $ this ->assertEquals ("function() { return $('#test').html(); } " ,
161+ $ builder ->getAttributes ()['layout ' ]['topStart ' ]);
160162
161163 $ builder ->layout (fn (Layout $ layout ) => $ layout ->topEndView ('#test ' ));
162164 $ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
@@ -166,11 +168,15 @@ public function it_can_accept_js_selector_for_layout_content(): void
166168 $ builder ->layout (fn (Layout $ layout ) => $ layout ->bottomStartView ('#test ' ));
167169 $ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
168170 $ this ->assertArrayHasKey ('bottomStart ' , $ builder ->getAttributes ()['layout ' ]);
169- $ this ->assertEquals ("function() { return $('#test').html(); } " , $ builder ->getAttributes ()['layout ' ]['bottomStart ' ]);
171+ $ this ->assertEquals ("function() { return $('#test').html(); } " ,
172+ $ builder ->getAttributes ()['layout ' ]['bottomStart ' ]);
170173
171174 $ builder ->layout (fn (Layout $ layout ) => $ layout ->bottomEndView ('#test ' ));
172175 $ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
173176 $ this ->assertArrayHasKey ('bottomEnd ' , $ builder ->getAttributes ()['layout ' ]);
174- $ this ->assertEquals ("function() { return $('#test').html(); } " , $ builder ->getAttributes ()['layout ' ]['bottomEnd ' ]);
177+ $ this ->assertEquals (
178+ "function() { return $('#test').html(); } " ,
179+ $ builder ->getAttributes ()['layout ' ]['bottomEnd ' ]
180+ );
175181 }
176182}
0 commit comments