public function testTooFewServersToRelease($count, $available)
{
$mutex = $this->buildRedisMutex($count);
$mutex->expects($this->any())->method("add")->willReturn(true);
$i = 0;
$mutex->expects($this->any())->method("evalScript")->willReturnCallback(function () use(&$i, $available) {
if ($i < $available) {
$i++;
return true;
} else {
throw new LockReleaseException();
}
});
$mutex->synchronized(function () {
});
}