Phpunit: How to test private method?

Created on 2 Feb 2012  路  2Comments  路  Source: sebastianbergmann/phpunit

Hi all,

How do I test a private method in via PHPUnit? Currently, I found that I must turn the method into public into to test it. Thanks.

p.s. Please do not suggest not testing the private method, thank you.

Most helpful comment

This is not a support forum, sorry. Have a look at http://sebastian-bergmann.de/archives/881-Testing-Your-Privates.html

All 2 comments

This is not a support forum, sorry. Have a look at http://sebastian-bergmann.de/archives/881-Testing-Your-Privates.html

If you need help please ask on the irc channel or on any forum. We can't provide help for phpunit users in that way. http://stackoverflow.com/questions/5010300/best-practices-to-test-protected-methods-with-phpunit-on-abstract-classes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AnmSaiful picture AnmSaiful  路  4Comments

sebastianbergmann picture sebastianbergmann  路  4Comments

kunjalpopat picture kunjalpopat  路  4Comments

sebastianbergmann picture sebastianbergmann  路  4Comments

sebastianbergmann picture sebastianbergmann  路  3Comments