8000 minor #50097 Fix tests for the Lock component (stof) · symfony/symfony@74ad684 · GitHub
[go: up one dir, main page]

Skip to content

Commit 74ad684

Browse files
committed
minor #50097 Fix tests for the Lock component (stof)
This PR was merged into the 6.3 branch. Discussion ---------- Fix tests for the Lock component | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | n/a #50090 was merged with a failing CI (caused by 1 place I forgot to update) Commits ------- 08cb39e Fix tests for the Lock component
2 parents b6e8cdd + 08cb39e commit 74ad684

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Symfony/Component/Lock/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);

src/Symfony/Component/Lock/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)
0