BetterReflectionTest\Reflection\ReflectionParameterTest::testGetTypeHint PHP Метод

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

public testGetTypeHint ( string $parameterToTest, string $expectedType, string | null $expectedFqsen = null, string | null $expectedFqsenName = null )
$parameterToTest string
$expectedType string
$expectedFqsen string | null
$expectedFqsenName string | null
    public function testGetTypeHint($parameterToTest, $expectedType, $expectedFqsen = null, $expectedFqsenName = null)
    {
        $classInfo = $this->reflector->reflect('\\BetterReflectionTest\\Fixture\\Methods');
        $method = $classInfo->getMethod('methodWithExplicitTypedParameters');
        $type = $method->getParameter($parameterToTest)->getTypeHint();
        $this->assertInstanceOf($expectedType, $type);
        if (null !== $expectedFqsen) {
            $this->assertSame($expectedFqsen, (string) $type->getFqsen());
        }
        if (null !== $expectedFqsenName) {
            $this->assertSame($expectedFqsenName, $type->getFqsen()->getName());
        }
    }