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

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@tubalmartin

@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.

@philsturgeon
@tubalmartin

Thanks for the explanation Phil ;)

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