Skip to content

Commit

Permalink
add lock test
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Mar 4, 2020
1 parent c44ad36 commit 226ea07
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Cache/CacheArrayStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ public function testAnotherOwnerCanForceReleaseALock()
$this->assertTrue($wannabeOwner->acquire());
}

public function testReleasingLockAfterAlreadyForceReleasedByAnotherOwnerFails()
{
$store = new ArrayStore;
$owner = $store->lock('foo', 10);
$wannabeOwner = $store->lock('foo', 10);
$owner->acquire();
$wannabeOwner->forceRelease();

$this->assertFalse($wannabeOwner->release());
}

public function testValuesAreNotStoredByReference()
{
$store = new ArrayStore($serialize = true);
Expand Down

0 comments on commit 226ea07

Please sign in to comment.