File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app-modules/project/tests/Tenant/Filament/Resources/ProjectResource/Pages Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 163
163
});
164
164
165
165
it ('correctly prunes ProjectFiles based on retention_date ' , function () {
166
+ asSuperAdmin ();
167
+
168
+ $ project = Project::factory ()->create ();
166
169
$ expiredFile = ProjectFile::factory ()->create ([
170
+ 'project_id ' => $ project ->id ,
167
171
'retention_date ' => fake ()->dateTimeBetween ('-1 year ' , '-1 day ' ),
168
172
]);
169
173
170
174
$ noRetentionDateFile = ProjectFile::factory ()->create ([
175
+ 'project_id ' => $ project ->id ,
171
176
'retention_date ' => null ,
172
177
]);
173
178
174
179
$ futureRetentionDateFile = ProjectFile::factory ()->create ([
180
+ 'project_id ' => $ project ->id ,
175
181
'retention_date ' => fake ()->dateTimeBetween ('+1 day ' , '+ 1 year ' ),
176
182
]);
177
183
191
197
$ projectFileClass = preg_quote (ProjectFile::class);
192
198
193
199
return preg_match ("/model:prune\s--model=.* {$ projectFileClass }.*/ " , $ event ->command )
194
- && $ event ->expression === '0 0 * * * ' ;
200
+ && $ event ->expression === '0 0 * * * ' ;
195
201
});
196
202
197
203
expect ($ events )->toHaveCount (1 );
You can’t perform that action at this time.
0 commit comments