11<?php
22
3- use Tests \ Feature \ TestUserResource ;
3+ use Kirschbaum \ Loop \ Filament \ DescribeFilamentResourceTool ;
44use Tests \Feature \TestPostWithRelationsResource ;
5+ use Tests \Feature \TestUserResource ;
56use Tests \Feature \TestUserWithRelationsResource ;
6- use Kirschbaum \Loop \Filament \DescribeFilamentResourceTool ;
77
88it ('can instantiate the describe filament resource tool ' , function () {
9- $ tool = new DescribeFilamentResourceTool () ;
9+ $ tool = new DescribeFilamentResourceTool ;
1010
1111 expect ($ tool )->toBeInstanceOf (DescribeFilamentResourceTool::class);
1212 expect ($ tool ->getName ())->toBe ('describe_filament_resource ' );
1313});
1414
1515it ('can extract table schema using the tool ' , function () {
16- $ tool = new DescribeFilamentResourceTool () ;
16+ $ tool = new DescribeFilamentResourceTool ;
1717 $ resource = app (TestUserResource::class);
1818
1919 $ tableSchema = $ tool ->extractTableSchema ($ resource );
2828});
2929
3030it ('can extract column properties through the tool ' , function () {
31- $ tool = new DescribeFilamentResourceTool () ;
31+ $ tool = new DescribeFilamentResourceTool ;
3232 $ resource = app (TestUserResource::class);
3333
3434 $ tableSchema = $ tool ->extractTableSchema ($ resource );
4646});
4747
4848it ('can extract bulk actions through the tool ' , function () {
49- $ tool = new DescribeFilamentResourceTool () ;
49+ $ tool = new DescribeFilamentResourceTool ;
5050 $ resource = app (TestUserResource::class);
5151
5252 $ tableSchema = $ tool ->extractTableSchema ($ resource );
5757});
5858
5959it ('can extract resource relationships through the tool ' , function () {
60- $ tool = new DescribeFilamentResourceTool () ;
60+ $ tool = new DescribeFilamentResourceTool ;
6161 $ resource = app (TestUserWithRelationsResource::class);
6262
6363 $ relationships = $ tool ->extractRelationshipsInfo ($ resource );
7575});
7676
7777it ('can describe a complete resource using the tool ' , function () {
78- $ tool = new DescribeFilamentResourceTool () ;
78+ $ tool = new DescribeFilamentResourceTool ;
7979
8080 $ result = $ tool ->describe (TestUserWithRelationsResource::class);
8181
9595});
9696
9797it ('can extract different relationship types including belongsTo ' , function () {
98- $ tool = new DescribeFilamentResourceTool () ;
98+ $ tool = new DescribeFilamentResourceTool ;
9999 $ resource = app (TestPostWithRelationsResource::class);
100100
101101 $ relationships = $ tool ->extractRelationshipsInfo ($ resource );
113113});
114114
115115it ('can describe a resource with mixed relationship types ' , function () {
116- $ tool = new DescribeFilamentResourceTool () ;
116+ $ tool = new DescribeFilamentResourceTool ;
117117
118118 $ result = $ tool ->describe (TestPostWithRelationsResource::class);
119119
127127 expect ($ relationships )->toHaveKeys (['comments ' , 'category ' ])
128128 ->and ($ relationships ['comments ' ]['type ' ])->toBe ('HasMany ' )
129129 ->and ($ relationships ['category ' ]['type ' ])->toBe ('BelongsTo ' );
130- });
130+ });
0 commit comments