Unit tests: Updated unit tests for url_title() helper function #1124

wants to merge 1 commit into


None yet

2 participants



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.


Thanks for the explanation Phil ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment