Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Conversation

tubalmartin
Copy link
Contributor

@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
Copy link
Contributor

These changes were introduced by @narfbg into the develop branch. You made changed to 2.1-stable which is fine, but unit tests are based on develop.

2.1-stable is different from develop.

Phil Sturgeon
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Monday, 5 March 2012 at 00:39, Túbal Martín wrote:

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

You can merge this Pull Request by running:

git pull https://github.com/tubalmartin/CodeIgniter feature/unit-tests

Or you can view, comment on it, or merge it online at:

#1124

-- Commit Summary --

  • Updated unit tests for url_title() helper function

-- File Changes --

M tests/codeigniter/helpers/url_helper_test.php (20)

-- Patch Links --

https://github.com/EllisLab/CodeIgniter/pull/1124.patch
https://github.com/EllisLab/CodeIgniter/pull/1124.diff


Reply to this email directly or view it on GitHub:
#1124

@tubalmartin
Copy link
Contributor Author

Thanks for the explanation Phil ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants