File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -211,10 +211,14 @@ public function testVisualFoxProWriteCopy(): void
211211 {
212212 $ original = __DIR__ .'/Resources/foxpro/vfp.dbf ' ;
213213 $ copyTo = $ this ->duplicateFile ($ original );
214- $ table = new WritableTable ($ copyTo );
215- $ table ->writeRecord ();
216- $ table ->close ();
217- self ::assertFileEquals ($ original , $ copyTo );
214+ try {
215+ $ table = new WritableTable ($ copyTo );
216+ $ table ->writeRecord ();
217+ $ table ->close ();
218+ self ::assertFileEquals ($ original , $ copyTo );
219+ } finally {
220+ unlink ($ copyTo );
221+ }
218222 }
219223
220224 /**
@@ -224,12 +228,16 @@ public function testVisualFoxProWriteCopy2(): void
224228 {
225229 $ original = __DIR__ .'/Resources/foxpro/vfp.dbf ' ;
226230 $ copyTo = $ this ->duplicateFile ($ original );
227- $ table = new WritableTable ($ copyTo );
228- $ table ->appendRecord ();
229- $ table ->deleteRecord ();
230- $ table ->writeRecord ();
231- $ table ->close ();
232- self ::assertFileEquals ($ original , $ copyTo );
231+ try {
232+ $ table = new WritableTable ($ copyTo );
233+ $ table ->appendRecord ();
234+ $ table ->deleteRecord ();
235+ $ table ->writeRecord ();
236+ $ table ->close ();
237+ self ::assertFileEquals ($ original , $ copyTo );
238+ } finally {
239+ unlink ($ copyTo );
240+ }
233241 }
234242
235243 /**
You can’t perform that action at this time.
0 commit comments