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

Add unit tests for the NewFunctions sniff. #161

Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 13, 2016

The functions in the NewFunctions sniff appeared not to be covered by unit tests.
These have now been added.

Also:

  • Make function name comparison case-insensitive as function calls are case-insensitive in PHP.
  • Exclude namespaced functions from this sniff (basic check).
  • Removed empty item from functions list
  • Added numerous extra functions to sniff for.

Additionally some extra noViolation tests have been set up to make sure namespaced function calls will not be reported by this sniff.

Removed the new methods which were mixed into the functions list as they can not be tested for in this way. Most cannot be called statically and if not called statically, there is little way to tell if the method belongs to that class.

The functions in the `NewFunctions` sniff appeared not to be covered by unit tests.
These have now been added.

Also:
* Make function name comparison case-insensitive as function calls are case-insensitive in PHP.
* Exclude namespaced functions from this sniff (basic check).
* Removed empty item from functions list
* Added numerous extra functions to sniff for.

Additionally some extra `noViolation` tests have been set up to make sure namespaced function calls will not be reported by this sniff.

Removed the new methods which were mixed into the functions list as they can not be tested for in this way. Most cannot be called statically and if not called statically, there is little way to tell if the method belongs to that class.
@jrfnl jrfnl force-pushed the feature/new-functions-unit-tests branch from e66086f to 1909338 Compare August 13, 2016 13:00
@wimg wimg merged commit 681688b into PHPCompatibility:master Aug 13, 2016
@jrfnl jrfnl deleted the feature/new-functions-unit-tests branch August 13, 2016 14:33
@jrfnl jrfnl added this to the 7.0.3 milestone Apr 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants