Created
December 7, 2010 15:34
-
-
Save fabeat/731908 to your computer and use it in GitHub Desktop.
Unit tests of protected methods in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo | |
{ | |
protected function bar($test) | |
{ | |
echo $test; | |
} | |
} | |
$foo = new Foo(); | |
$bar = new ReflectionMethod($foo, 'bar'); | |
$bar->setAccessible(true); | |
$bar->invoke($foo, 'TEST'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment