[OptionsResolver] fix counting of options

and make sure the tests are compatible with phpunit strict mode
[OptionsResolver] fix invalid value exception formatting
[OptionsResolver] fix calling resolve from within closure
[OptionsResolver] add missing exception based on OutOfBoundsException and clarify message