Unit tests: Updated unit tests for url_title() helper function #1124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@philsturgeon
I've already written the tests. However I've noticed the url_title() function in the feature/unit-tests branch is a bit different from the one in the 2.1-stable branch (the one I requested for a merge).
For example:
The unit-tests branch version uses
=== 'dash'
instead of==
. That's fine but why not use the identical operator for=== 'underscore'
too?Here's another one, the unit-tests branch version makes a double trim
trim(trim(...))
. That's useless since the regular expression '\s+' takes care of leading and trailing spaces (spaces get converted to $separator).I don't know who introduced those changes but they are not needed IMHO and I don't understand how Unit tests can be useful when the code used in unit tests can be different from the production code.