4
4
5
5
use PHPUnit \Framework \Attributes \Test ;
6
6
use Yajra \DataTables \Html \Builder ;
7
+ use Yajra \DataTables \Html \Enums \LayoutPosition ;
7
8
use Yajra \DataTables \Html \Layout ;
8
9
9
10
class LayoutTest extends TestCase
@@ -36,16 +37,16 @@ public function it_can_set_positions(): void
36
37
$ layout ->bottom ('test ' , 1 );
37
38
$ this ->assertEquals ('test ' , $ layout ->get ('bottom1 ' ));
38
39
39
- $ layout ->top ('test ' , 1 , ' Start ' );
40
+ $ layout ->top ('test ' , 1 , LayoutPosition:: Start);
40
41
$ this ->assertEquals ('test ' , $ layout ->get ('top1Start ' ));
41
42
42
- $ layout ->bottom ('test ' , 1 , ' Start ' );
43
+ $ layout ->bottom ('test ' , 1 , LayoutPosition:: Start);
43
44
$ this ->assertEquals ('test ' , $ layout ->get ('bottom1Start ' ));
44
45
45
- $ layout ->top ('test ' , 1 , ' End ' );
46
+ $ layout ->top ('test ' , 1 , LayoutPosition:: End);
46
47
$ this ->assertEquals ('test ' , $ layout ->get ('top1End ' ));
47
48
48
- $ layout ->bottom ('test ' , 1 , ' End ' );
49
+ $ layout ->bottom ('test ' , 1 , LayoutPosition:: End);
49
50
$ this ->assertEquals ('test ' , $ layout ->get ('bottom1End ' ));
50
51
}
51
52
@@ -62,10 +63,10 @@ public function it_can_be_used_in_builder(): void
62
63
$ layout ->bottomEnd ('test ' );
63
64
$ layout ->top ('test ' , 1 );
64
65
$ 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);
69
70
});
70
71
71
72
$ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
@@ -156,7 +157,8 @@ public function it_can_accept_js_selector_for_layout_content(): void
156
157
$ builder ->layout (fn (Layout $ layout ) => $ layout ->topStartView ('#test ' ));
157
158
$ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
158
159
$ 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 ' ]);
160
162
161
163
$ builder ->layout (fn (Layout $ layout ) => $ layout ->topEndView ('#test ' ));
162
164
$ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
@@ -166,11 +168,15 @@ public function it_can_accept_js_selector_for_layout_content(): void
166
168
$ builder ->layout (fn (Layout $ layout ) => $ layout ->bottomStartView ('#test ' ));
167
169
$ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
168
170
$ 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 ' ]);
170
173
171
174
$ builder ->layout (fn (Layout $ layout ) => $ layout ->bottomEndView ('#test ' ));
172
175
$ this ->assertArrayHasKey ('layout ' , $ builder ->getAttributes ());
173
176
$ 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
+ );
175
181
}
176
182
}
0 commit comments