Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/Feature/LockFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,13 @@ public function testExtendLock() {

// We should have one lock for that file with 15 minutes ETA
$this->assertCount(1, $locks);
$this->assertEquals(15 * 60, $locks[0]->getEta());
$this->assertEqualsWithDelta(15 * 60, $locks[0]->getEta(), 2, 'Initial lock ETA should be approximately 15 minutes');

// going to the future we see the ETA to be 5 minutes
$this->toTheFuture(10 * 60);
$locks = $this->lockManager->getLocks($file->getId());
$this->assertCount(1, $locks);
$this->assertEquals(5 * 60, $locks[0]->getEta());
$this->assertEqualsWithDelta(5 * 60, $locks[0]->getEta(), 2, 'After 10 minutes, ETA should be approximately 5 minutes');
$id = $locks[0]->getId();

// Extend the lock (lock again)
Expand All @@ -376,7 +376,7 @@ public function testExtendLock() {
// The lock should only be extended, so same ID but fresh ETA
$locks = $this->lockManager->getLocks($file->getId());
$this->assertCount(1, $locks);
$this->assertEquals(15 * 60, $locks[0]->getEta());
$this->assertEqualsWithDelta(15 * 60, $locks[0]->getEta(), 2, 'Extended lock ETA should be approximately 15 minutes');
$this->assertEquals($id, $locks[0]->getId());
}

Expand Down
Loading