public function testLockFails() { $this->mutex->expects($this->any())->method("lock")->willThrowException(new LockAcquireException()); $this->mutex->synchronized(function () { $this->fail("Should not execute code."); }); }