|
@@ 11-26 (lines=16) @@
|
| 8 |
|
|
| 9 |
|
class SnapshotServiceTest extends BaseTest |
| 10 |
|
{ |
| 11 |
|
public function testGetSnapshots() |
| 12 |
|
{ |
| 13 |
|
$snapshot = $this->makeSnapshot('Message', 123); |
| 14 |
|
$this->handleFileSnapshot($snapshot); |
| 15 |
|
|
| 16 |
|
/** @var SnapshotService $service */ |
| 17 |
|
$service = $this->container->get(SnapshotService::class); |
| 18 |
|
|
| 19 |
|
$this->assertCount(1, $service->getSnapshots()); |
| 20 |
|
|
| 21 |
|
sleep(1); |
| 22 |
|
$snapshot = $this->makeSnapshot('Message2', 456); |
| 23 |
|
$this->handleFileSnapshot($snapshot); |
| 24 |
|
|
| 25 |
|
$this->assertCount(2, $service->getSnapshots()); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
public function testGetSnapshot() |
| 29 |
|
{ |
|
@@ 91-108 (lines=18) @@
|
| 88 |
|
$this->assertFalse($service->exists($file->id())); |
| 89 |
|
} |
| 90 |
|
|
| 91 |
|
public function testDeleteSnapshots() |
| 92 |
|
{ |
| 93 |
|
$snapshot = $this->makeSnapshot('Message', 123); |
| 94 |
|
$this->handleFileSnapshot($snapshot); |
| 95 |
|
|
| 96 |
|
sleep(1); |
| 97 |
|
$snapshot = $this->makeSnapshot('Message2', 456); |
| 98 |
|
$this->handleFileSnapshot($snapshot); |
| 99 |
|
|
| 100 |
|
/** @var SnapshotService $service */ |
| 101 |
|
$service = $this->container->get(SnapshotService::class); |
| 102 |
|
|
| 103 |
|
$this->assertCount(2, $service->getSnapshots()); |
| 104 |
|
|
| 105 |
|
$service->deleteSnapshots(); |
| 106 |
|
|
| 107 |
|
$this->assertCount(0, $service->getSnapshots()); |
| 108 |
|
} |
| 109 |
|
} |