File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 55it ('can delete old snapshots keeping the desired number of snapshots ' , function () {
66 // Add sleep to make sure files do not have the same modified time.
77 // They may not sort properly if all have the same timestamp.
8- $ this -> clearDisk ();
8+ clearDisk ();
99
1010 $ this ->disk ->put ('snapshot1.sql ' , 'new content ' );
1111
2020});
2121
2222it ('can delete all snapshots if keep is zero ' , function () {
23- $ this -> clearDisk ();
23+ clearDisk ();
2424
2525 $ this ->disk ->put ('snapshot.sql ' , 'new content ' );
2626
3030});
3131
3232it ('warns if keep is not specified ' , function () {
33- $ this -> clearDisk ();
33+ clearDisk ();
3434
3535 $ this ->disk ->put ('snapshot.sql ' , 'new content ' );
3636
Original file line number Diff line number Diff line change 5050
5151// Functions
5252
53+ function clearDisk (): void
54+ {
55+ test ()->disk ->delete (test ()->disk ->allFiles ());
56+ }
57+
5358function seeInConsoleOutput (string |array $ searchStrings ): void
5459{
5560 if (!is_array ($ searchStrings )) {
Original file line number Diff line number Diff line change @@ -86,15 +86,10 @@ protected function setUpDisk()
8686 {
8787 $ this ->disk = app (Factory::class)->disk ('snapshots ' );
8888
89- $ this -> clearDisk ();
89+ clearDisk ();
9090 $ this ->createDummySnapshots ();
9191 }
9292
93- protected function clearDisk ()
94- {
95- $ this ->disk ->delete ($ this ->disk ->allFiles ());
96- }
97-
9893 protected function createDummySnapshots ()
9994 {
10095 foreach (range (1 , 3 ) as $ i ) {
You can’t perform that action at this time.
0 commit comments