Skip to content

Commit e7ada2e

Browse files
committed
Fix tests for the Lock component
1 parent 5d60291 commit e7ada2e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

Tests/LockFactoryTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public function testCreateLock()
3535
$keys[] = $key;
3636

3737
return true;
38-
}))
39-
->willReturn(true);
38+
}));
4039

4140
$logger = $this->createMock(LoggerInterface::class);
4241
$factory = new LockFactory($store);
@@ -65,8 +64,7 @@ public function testCreateLockFromKey()
6564
$keys[] = $key;
6665

6766
return true;
68-
}))
69-
->willReturn(true);
67+
}));
7068

7169
$logger = $this->createMock(LoggerInterface::class);
7270
$factory = new LockFactory($store);

Tests/LockTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -516,16 +516,14 @@ public function testAcquireTwiceWithExpiration()
516516
private $keys = [];
517517
private $initialTtl = 30;
518518

519-
public function save(Key $key)
519+
public function save(Key $key): void
520520
{
521521
$key->reduceLifetime($this->initialTtl);
522522
$this->keys[spl_object_hash($key)] = $key;
523523
$this->checkNotExpired($key);
524-
525-
return true;
526524
}
527525

528-
public function delete(Key $key)
526+
public function delete(Key $key): void
529527
{
530528
unset($this->keys[spl_object_hash($key)]);
531529
}
@@ -535,7 +533,7 @@ public function exists(Key $key): bool
535533
return isset($this->keys[spl_object_hash($key)]);
536534
}
537535

538-
public function putOffExpiration(Key $key, $ttl)
536+
public function putOffExpiration(Key $key, $ttl): void
539537
{
540538
$key->reduceLifetime($ttl);
541539
$this->checkNotExpired($key);

0 commit comments

Comments
 (0)