/**
* @dataProvider internalSymbolsProvider
*
* @param string $className
* @throws \ReflectionException
*/
public function testCanReflectInternalClasses($className)
{
/* @var $class */
$phpInternalSourceLocator = new PhpInternalSourceLocator();
$reflector = new ClassReflector($phpInternalSourceLocator);
try {
$class = $reflector->reflect($className);
} catch (\ReflectionException $e) {
if ($phpInternalSourceLocator->hasStub($className)) {
throw $e;
}
$this->markTestIncomplete(sprintf('Can\'t reflect class "%s" due to an internal reflection exception: "%s". Consider adding a stub class', $className, $e->getMessage()));
}
$this->assertInstanceOf(ReflectionClass::class, $class);
$this->assertSame($className, $class->getName());
$this->assertTrue($class->isInternal());
$this->assertFalse($class->isUserDefined());
$internalReflection = new \ReflectionClass($className);
$this->assertSame($internalReflection->isInterface(), $class->isInterface());
$this->assertSame($internalReflection->isTrait(), $class->isTrait());
}