Last active
December 6, 2015 18:58
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