File tree Expand file tree Collapse file tree 1 file changed +18
-20
lines changed Expand file tree Collapse file tree 1 file changed +18
-20
lines changed Original file line number Diff line number Diff line change 22
33namespace Spatie \DbSnapshots \Commands \Test ;
44
5- use Mockery as m ;
65use Spatie \DbSnapshots \Test \TestCase ;
76use Illuminate \Support \Facades \Artisan ;
8- use Illuminate \Support \Facades \Storage ;
97
108class CleanupTest extends TestCase
119{
12- /** @test */
13- public function it_can_delete_old_snapshots_keeping_the_desired_number_of_snapshots ()
14- {
15- // Add sleep to make sure files do not have the same modified time.
16- // They may not sort properly if all have the same timestamp.
17- $ this ->clearDisk ();
18-
19- $ this ->disk ->put (" snapshot1.sql " , 'new content ' );
20-
21- sleep (1 );
22-
23- $ this ->disk ->put (" snapshot2.sql " , 'new content ' );
24-
25- Artisan::call ('snapshot:cleanup ' , ['--keep ' => 1 ]);
26-
27- $ this ->disk ->assertMissing ('snapshot1.sql ' );
28- $ this ->disk ->assertExists ('snapshot2.sql ' );
29- }
10+ /** @test */
11+ public function it_can_delete_old_snapshots_keeping_the_desired_number_of_snapshots ()
12+ {
13+ // Add sleep to make sure files do not have the same modified time.
14+ // They may not sort properly if all have the same timestamp.
15+ $ this ->clearDisk ();
16+
17+ $ this ->disk ->put (' snapshot1.sql ' , 'new content ' );
18+
19+ sleep (1 );
20+
21+ $ this ->disk ->put (' snapshot2.sql ' , 'new content ' );
22+
23+ Artisan::call ('snapshot:cleanup ' , ['--keep ' => 1 ]);
24+
25+ $ this ->disk ->assertMissing ('snapshot1.sql ' );
26+ $ this ->disk ->assertExists ('snapshot2.sql ' );
27+ }
3028}
You can’t perform that action at this time.
0 commit comments