Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Make methods setUp and tearDown protected #4783

Closed
wants to merge 1 commit into from

Conversation

gag237
Copy link
Contributor

@gag237 gag237 commented Jul 4, 2013

In phpunit these methods is protected.

@localheinz
Copy link
Member

👍

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 313ff1b on gag237:setUp_is_protected into 260205f on zendframework:develop.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 313ff1b on gag237:setUp_is_protected into 260205f on zendframework:develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 313ff1b on gag237:setUp_is_protected into 260205f on zendframework:develop.

@weierophinney
Copy link
Member

PHP allows extending classes to redefine visibility of methods as long as the new visibility is more permissive; I see no reason to change this, particularly as it's common practice to define these methods as public when writing test cases.

@gag237
Copy link
Contributor Author

gag237 commented Jul 6, 2013

Methods are never called from outside the object, in other words there is no need to be public.

The second argument: from a protected to public can do always, and not the reverse; so get the error: "Access level to setUp () must be public"

@ghost ghost assigned weierophinney Jul 15, 2013
@DASPRiD
Copy link
Member

DASPRiD commented Jul 15, 2013

Does this cover all occurences?

@gag237
Copy link
Contributor Author

gag237 commented Jul 15, 2013

TestCase these are intended for use outside zf2.
The other TestCase Used for internal testing. Therefore, there is not changed. If you want to change and there - let me know.

weierophinney added a commit that referenced this pull request Jul 17, 2013
@weierophinney
Copy link
Member

Cherry-picked into master and merged to develop.

weierophinney added a commit to zendframework/zend-test that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-test that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants