BetterReflectionTest\Reflection\ReflectionFunctionAbstractTest::testGetReturnTypeWithDeclaredType PHP Метод

testGetReturnTypeWithDeclaredType() публичный Метод

public testGetReturnTypeWithDeclaredType ( string $functionToReflect, string $expectedType )
$functionToReflect string
$expectedType string
    public function testGetReturnTypeWithDeclaredType($functionToReflect, $expectedType)
    {
        $reflector = new FunctionReflector(new SingleFileSourceLocator(__DIR__ . '/../Fixture/Php7ReturnTypeDeclarations.php'));
        $functionInfo = $reflector->reflect($functionToReflect);
        $reflectionType = $functionInfo->getReturnType();
        $this->assertInstanceOf(ReflectionType::class, $reflectionType);
        $this->assertSame($expectedType, (string) $reflectionType);
    }