/** * @covers PsUtil::newReflectionMethod */ public function testNewReflectionMethod() { PsUtil::assertInstanceOf(PsUtil::newReflectionMethod(ClassA::get__CLASS__(), 'get__FILE__'), 'ReflectionMethod'); PsUtil::assertInstanceOf(PsUtil::newReflectionMethod(new ClassA(), 'private_final_method'), 'ReflectionMethod'); try { PsUtil::newReflectionMethod(new ClassA(), self::NOT_ALLOWED_STR); $this->fail('ReflectionException is expected'); } catch (ReflectionException $ex) { //OK } }
public function __construct($class, $method) { $this->rm = PsUtil::newReflectionMethod($class, $method); }