use Symfony\Component\Lock\LockInterface;
use Symfony\Component\Lock\NoLock;
use Symfony\Component\Lock\Store\InMemoryStore;
use Symfony\Component\Scheduler\Generator\Checkpoint;
class CheckpointTest extends TestCase
{ public function testWithoutLockAndWithoutState() { $now =
new \
DateTimeImmutable('2020-02-20 20:20:20Z'
);
$later =
$now->
modify('1 hour'
);
$checkpoint =
new Checkpoint('dummy'
);
$this->
assertTrue($checkpoint->
acquire($now));
$this->
assertSame($now,
$checkpoint->
time());
$this->
assertSame(-1,
$checkpoint->
index());
$checkpoint->
save($later, 7
);
$this->
assertSame($later,
$checkpoint->
time());
$this->
assertSame(7,
$checkpoint->
index());
$checkpoint->
release($later, null
);
}