Add tests and fixes for checkAllPatchesAvailable()