Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthi4s committed Jan 13, 2025
1 parent c06d290 commit d2ae481
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/LockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,14 @@ public function testLockDeleteConflict(): void
*/
public function testLockFunctionUsesUniqueDefaultIdentifierIfNoIdentifierParameterIsProvided(): void
{
$lock = new Lock($this->getRandomString());

# Default identifier is not set explicitly and its default value is null.
# (We have to set it to null manually because other tests might have set the default identifier before.)
$reflection = new \ReflectionProperty(Lock::class, 'defaultIdentifier');
$reflection->setAccessible(true);
$reflection->setValue(null);
$this->assertNull($reflection->getValue());

# lock() sets the default identifier to an uniqid()
$lock = new Lock($this->getRandomString());
$lock->lock();
$defaultIdentifier = $reflection->getValue();
$this->assertIsString($defaultIdentifier);
Expand Down

0 comments on commit d2ae481

Please sign in to comment.