. */ /* */ /**********************************************************************************/ namespace Thelia\Tools; /** * Created by JetBrains PhpStorm. * Date: 8/19/13 * Time: 3:24 PM * * Helper for Unit Testing * * @package Coupon * @author Guillaume MOREL * */ class PhpUnitUtils { /** * Allow to call a protected methods * * @param Object $obj Class name + namespace * @param string $name Method name * @param array $args Method arguments * * @return mixed protected method result */ public static function callMethod($obj, $name, array $args) { $class = new \ReflectionClass(get_class($obj)); $method = $class->getMethod($name); $method->setAccessible(true); return $method->invokeArgs($obj, $args); } }