public function testGetTypeMethod()
 {
     if (PHP_VERSION_ID < 70000) {
         $this->markTestSkipped('Test available only for PHP7.0 and newer');
     }
     foreach ($this->parsedRefFile->getFileNamespaces() as $fileNamespace) {
         foreach ($fileNamespace->getFunctions() as $refFunction) {
             $functionName = $refFunction->getName();
             foreach ($refFunction->getParameters() as $refParameter) {
                 $parameterName = $refParameter->getName();
                 $originalRefParameter = new \ReflectionParameter($functionName, $parameterName);
                 $hasType = $refParameter->hasType();
                 $this->assertSame($originalRefParameter->hasType(), $hasType, "Presence of type for parameter {$functionName}:{$parameterName} should be equal");
                 if ($hasType) {
                     $parsedReturnType = $refParameter->getType();
                     $originalReturnType = $originalRefParameter->getType();
                     $this->assertSame($originalReturnType->allowsNull(), $parsedReturnType->allowsNull());
                     $this->assertSame($originalReturnType->isBuiltin(), $parsedReturnType->isBuiltin());
                     $this->assertSame($originalReturnType->__toString(), $parsedReturnType->__toString());
                 } else {
                     $this->assertSame($originalRefParameter->getType(), $refParameter->getType());
                 }
             }
         }
     }
 }
 public function testGetReturnTypeMethod()
 {
     if (PHP_VERSION_ID < 70000) {
         $this->markTestSkipped('Test available only for PHP7.0 and newer');
     }
     $fileName = stream_resolve_include_path(__DIR__ . self::STUB_FILE70);
     $reflectionFile = new ReflectionFile($fileName);
     include $fileName;
     foreach ($reflectionFile->getFileNamespaces() as $fileNamespace) {
         foreach ($fileNamespace->getFunctions() as $refFunction) {
             $functionName = $refFunction->getName();
             $originalRefFunction = new \ReflectionFunction($functionName);
             $hasReturnType = $refFunction->hasReturnType();
             $this->assertSame($originalRefFunction->hasReturnType(), $hasReturnType, "Presence of return type for function {$functionName} should be equal");
             if ($hasReturnType) {
                 $parsedReturnType = $refFunction->getReturnType();
                 $originalReturnType = $originalRefFunction->getReturnType();
                 $this->assertSame($originalReturnType->allowsNull(), $parsedReturnType->allowsNull());
                 $this->assertSame($originalReturnType->isBuiltin(), $parsedReturnType->isBuiltin());
                 $this->assertSame($originalReturnType->__toString(), $parsedReturnType->__toString());
             } else {
                 $this->assertSame($originalRefFunction->getReturnType(), $refFunction->getReturnType());
             }
         }
     }
 }
 public function testGetFileNamespaces()
 {
     $reflectionFileNamespaces = $this->parsedRefFile->getFileNamespaces();
     $this->assertCount(3, $reflectionFileNamespaces);
 }