9536ca738e
PHPUnit removed the ability to mock a destructor, but our lock system throws an exception if a lock has not been explicitly released in its destructor. Normally thhis is fine because the lock is released, and if not then we want to know about it. However, where we are mocking the lock, we do not actually obtain the lock, and we may expect the test to fail. This change moves the release and notification to a separate, reusable public method, which is called from the destructor. This allows it to be mocked at the appropriate time.