Last active
December 6, 2015 18:58
-
-
Save aaronpk/93686628577b8860cfe8 to your computer and use it in GitHub Desktop.
Make all protected methods public for PHPUnit
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 | |
/* | |
* Make all protected methods public for PHPUnit | |
*/ | |
class ExampleClassTest extends ExampleClassTest { | |
public function __call($method, $args) { | |
$method = new \ReflectionMethod('ExampleClass', $method); | |
$method->setAccessible(true); | |
return $method->invokeArgs($this, $args); | |
} | |
public static function __callStatic($method, $args) { | |
$method = new \ReflectionMethod('ExampleClass', $method); | |
$method->setAccessible(true); | |
return $method->invokeArgs(null, $args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment