public function testReflectWithAggregateSourceLocatorFindsClass() { $reflector = new Generic(new AggregateSourceLocator([new StringSourceLocator('<?php'), new StringSourceLocator('<?php class Foo {}')])); $classInfo = $reflector->reflect($this->getIdentifier('Foo', IdentifierType::IDENTIFIER_CLASS)); $this->assertInstanceOf(ReflectionClass::class, $classInfo); $this->assertSame('Foo', $classInfo->getName()); }
/** * Create a ReflectionClass for the specified $className. * * @param string $functionName * @return \BetterReflection\Reflection\ReflectionFunction */ public function reflect($functionName) { return $this->reflector->reflect(new Identifier($functionName, new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION))); }
/** * Create a ReflectionClass for the specified $className. * * @param string $className * @return \BetterReflection\Reflection\ReflectionClass */ public function reflect($className) { return $this->reflector->reflect(new Identifier($className, new IdentifierType(IdentifierType::IDENTIFIER_CLASS))); }
public function testReflectWithAggregateSourceLocatorFindsClass() { $this->markTestIncomplete('See https://github.com/Roave/BetterReflection/issues/123'); $reflector = new Generic(new AggregateSourceLocator([new StringSourceLocator('<?php'), new StringSourceLocator('<?php class Foo {}')])); $classInfo = $reflector->reflect($this->getIdentifier('Foo', IdentifierType::IDENTIFIER_CLASS)); $this->assertInstanceOf(ReflectionClass::class, $classInfo); $this->assertSame('Foo', $classInfo->getName()); }