public function testCodeExecuted()
{
$this->mutex->expects($this->once())->method("synchronized")->willReturnCallback(function (callable $block) {
return call_user_func($block);
});
$this->checkedLocking->setCheck(function () {
return true;
});
$executed = false;
$this->checkedLocking->then(function () use(&$executed) {
$executed = true;
});
$this->assertTrue($executed);
}