Pinq\Tests\Integration\Parsing\ReflectionTest::testFunction PHP Метод

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

public testFunction ( )
    public function testFunction()
    {
        $reflection = $this->interpreter->getReflection(__NAMESPACE__ . '\\func');
        $location = $reflection->getLocation();
        $scope = $reflection->getScope();
        $signature = $reflection->getSignature();
        $this->assertSame(__FILE__, $location->getFilePath());
        $this->assertSame(true, $location->inNamespace());
        $this->assertSame(__NAMESPACE__, $location->getNamespace());
        $this->assertSame(func()['start'], $location->getStartLine());
        $this->assertSame(func()['end'], $location->getEndLine());
        $this->assertSame(null, $scope->getThis());
        $this->assertEquals([], $scope->getVariableTable());
        $this->assertSame(null, $scope->getScopeType());
        $this->assertSame(null, $scope->getThisType());
        $this->assertSame(IFunctionSignature::TYPE_FUNCTION, $signature->getType());
        $this->assertSame(null, $signature->getAccessModifier());
        $this->assertSame(null, $signature->isStatic());
        $this->assertSame(false, $signature->returnsReference());
        $this->assertSame(null, $signature->getPolymorphModifier());
        $this->assertSame('func', $signature->getName());
        $this->assertEquals([O\Expression::parameter('foo', null, O\Expression::value(func()['start']))], $signature->getParameterExpressions());
        $this->assertEquals(null, $signature->getScopedVariableNames());
    }