postcode
postcode copied to clipboard
Testing with global formatter
Hi Ben, as discussed in the previous PR 13, i hereby present a new PR to make testing use the global postcode formatter.
A few things to note:
- Because this is a proof of concept commit, for readability i only changed the BE formatter test. Others will follow later of course if necessary.
- This PR makes al the
getFormatterfunctions in the tests and abstract test class obsolete but they have not yet been removed. - This PR introduces the new
getCountryfunction in the abstract test class using reflection because according to my research this is the easiest and fastest way. However i know that your not a fan of this which is why i am open to suggestions. It was also a fast way of showing you in this PR what i am trying to accomplish. Reflection does however reassure that the formatter has to bo named exactly in the same way as the test and if not, it will all fail. - I again want to stretch that this ensures that the test actually tests the actual output and format a user will see when using the public API of this package. Especially when a stripe or space is part of the format and future changes may interfere.
@BenMorel Looking forward to your viewings on this.