createFromNode() 공개 정적인 메소드

Cannot instantiate this way, use ReflectionObject::createFromInstance
public static createFromNode ( BetterReflection\Reflector\Reflector $reflector, ClassLike $node, BetterReflection\SourceLocator\Located\LocatedSource $locatedSource, Namespace_ $namespace = null )
$reflector BetterReflection\Reflector\Reflector
$node PhpParser\Node\Stmt\ClassLike
$locatedSource BetterReflection\SourceLocator\Located\LocatedSource
$namespace PhpParser\Node\Stmt\Namespace_
 public function testCreateFromNodeThrowsException()
 {
     /** @var Reflector|\PHPUnit_Framework_MockObject_MockObject $mReflector */
     $mReflector = $this->createMock(Reflector::class);
     /** @var ClassLike|\PHPUnit_Framework_MockObject_MockObject $mClassNode */
     $mClassNode = $this->createMock(ClassLike::class);
     /** @var LocatedSource|\PHPUnit_Framework_MockObject_MockObject $mLocatedSource */
     $mLocatedSource = $this->createMock(LocatedSource::class);
     $this->expectException(\LogicException::class);
     ReflectionObject::createFromNode($mReflector, $mClassNode, $mLocatedSource);
 }
 public function testCreateFromNodeThrowsException()
 {
     /** @var Reflector|\PHPUnit_Framework_MockObject_MockObject $mReflector */
     $mReflector = $this->getMockBuilder(Reflector::class)->disableOriginalConstructor()->getMock();
     /** @var ClassLike|\PHPUnit_Framework_MockObject_MockObject $mClassNode */
     $mClassNode = $this->getMockBuilder(ClassLike::class)->disableOriginalConstructor()->getMock();
     /** @var LocatedSource|\PHPUnit_Framework_MockObject_MockObject $mLocatedSource */
     $mLocatedSource = $this->getMockBuilder(LocatedSource::class)->disableOriginalConstructor()->getMock();
     $this->setExpectedException(\LogicException::class);
     ReflectionObject::createFromNode($mReflector, $mClassNode, $mLocatedSource);
 }