33namespace Yajra \DataTables \Fractal \Tests ;
44
55use Illuminate \Foundation \Testing \DatabaseTransactions ;
6+ use PHPUnit \Framework \Attributes \Test ;
7+ use Yajra \DataTables \Facades \DataTables ;
68use Yajra \DataTables \Fractal \Tests \Models \User ;
79use Yajra \DataTables \Fractal \Tests \Transformers \UserTransformer ;
810
911class FractalTest extends TestCase
1012{
1113 use DatabaseTransactions;
1214
13- /** @test */
15+ #[Test]
1416 public function it_can_transform_response ()
1517 {
1618 $ json = $ this ->getAjax ('/users ' );
@@ -25,7 +27,7 @@ public function it_can_transform_response()
2527 $ this ->assertIsString ($ json ['data ' ][0 ]['name ' ]);
2628 }
2729
28- /** @test */
30+ #[Test]
2931 public function it_works_with_closure ()
3032 {
3133 $ json = $ this ->getAjax ('/closure ' );
@@ -45,13 +47,13 @@ protected function setUp(): void
4547 parent ::setUp ();
4648
4749 $ this ->app ['router ' ]->get ('/users ' , function () {
48- return datatables ()-> eloquent (User::query ())
50+ return DataTables:: eloquent (User::query ())
4951 ->setTransformer (UserTransformer::class)
5052 ->toJson ();
5153 });
5254
5355 $ this ->app ['router ' ]->get ('/closure ' , function () {
54- return datatables ()-> eloquent (User::query ())
56+ return DataTables:: eloquent (User::query ())
5557 ->setTransformer (function (User $ user ) {
5658 return [
5759 'id ' => (int ) $ user ->id ,
0 commit comments