Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make all protected methods public for PHPUnit
<?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
You can’t perform that action at this time.