55use Illuminate \Support \Facades \Config ;
66use Illuminate \Support \Facades \Event ;
77use Illuminate \View \ViewException ;
8+ use RonasIT \Support \DTO \RelationsDTO ;
89use RonasIT \Support \Events \SuccessCreateMessage ;
910use RonasIT \Support \Events \WarningEvent ;
1011use RonasIT \Support \Exceptions \ClassAlreadyExistsException ;
@@ -65,11 +66,7 @@ className: ViewException::class,
6566 ->setFields ([
6667 'another_type ' => ['some_field ' ],
6768 ])
68- ->setRelations ([
69- 'hasOne ' => [],
70- 'hasMany ' => [],
71- 'belongsTo ' => [],
72- ])
69+ ->setRelations (new RelationsDTO ())
7370 ->setModel ('Post ' )
7471 ->generate ();
7572 }
@@ -84,11 +81,10 @@ public function testCreateSuccess()
8481 'string ' => ['title ' , 'iban ' , 'something ' ],
8582 'json ' => ['json_text ' ],
8683 ])
87- ->setRelations ([
88- 'hasOne ' => ['user ' ],
89- 'hasMany ' => [],
90- 'belongsTo ' => ['user ' ],
91- ])
84+ ->setRelations (new RelationsDTO (
85+ hasOne: ['user ' ],
86+ belongsTo: ['user ' ],
87+ ))
9288 ->setModel ('Post ' )
9389 ->generate ();
9490
@@ -112,11 +108,10 @@ public function testCreateFactoryWithoutFactoryStub(): void
112108 'string ' => ['title ' , 'iban ' , 'something ' ],
113109 'json ' => ['json_text ' ],
114110 ])
115- ->setRelations ([
116- 'hasOne ' => ['user ' ],
117- 'hasMany ' => [],
118- 'belongsTo ' => ['user ' ],
119- ])
111+ ->setRelations (new RelationsDTO (
112+ hasOne: ['user ' ],
113+ belongsTo: ['user ' ],
114+ ))
120115 ->setModel ('Post ' )
121116 ->generate ();
122117
@@ -144,11 +139,10 @@ public function testConfigFolderWithIncorrectCase(): void
144139 'string ' => ['title ' , 'iban ' , 'something ' ],
145140 'json ' => ['json_text ' ],
146141 ])
147- ->setRelations ([
148- 'hasOne ' => ['user ' ],
149- 'hasMany ' => [],
150- 'belongsTo ' => ['user ' ],
151- ])
142+ ->setRelations (new RelationsDTO (
143+ hasOne: ['user ' ],
144+ belongsTo: ['user ' ],
145+ ))
152146 ->setModel ('Post ' )
153147 ->generate ();
154148 }
@@ -165,11 +159,10 @@ public function testConfigFolderWithExtension(): void
165159 'string ' => ['title ' , 'iban ' , 'something ' ],
166160 'json ' => ['json_text ' ],
167161 ])
168- ->setRelations ([
169- 'hasOne ' => ['user ' ],
170- 'hasMany ' => [],
171- 'belongsTo ' => ['user ' ],
172- ])
162+ ->setRelations (new RelationsDTO (
163+ hasOne: ['user ' ],
164+ belongsTo: ['user ' ],
165+ ))
173166 ->setModel ('Post ' )
174167 ->generate ();
175168
0 commit comments