file_provider = new FakeFileProvider(); $config = new TestConfig(); $providers = new Providers( $this->file_provider, new ParserInstanceCacheProvider(), new FileStorageInstanceCacheProvider(), new ClassLikeStorageInstanceCacheProvider(), new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); $this->project_analyzer = new ProjectAnalyzer( $config, $providers ); $this->project_analyzer->setPhpVersion('7.3', 'tests'); } public function testValidInclude(): void { $test_name = $this->getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { $this->markTestSkipped('Skipped due to a bug.'); } $this->project_analyzer->getCodebase()->diff_methods = true; $codebase = $this->project_analyzer->getCodebase(); $vendor_files = [ getcwd() . DIRECTORY_SEPARATOR . 'V1.php' => ' ' ' 'storage) { return; } $result = $this->storage->getRecord()->getResult(); } }', ]; foreach ($vendor_files as $file_path => $contents) { $this->file_provider->registerFile($file_path, $contents); $codebase->scanner->addFilesToShallowScan([$file_path => $file_path]); } foreach ($analyzable_files as $file_path => $contents) { $this->file_provider->registerFile($file_path, $contents); $codebase->addFilesToAnalyze([$file_path => $file_path]); } $codebase->scanFiles(); $codebase->analyzer->analyzeFiles($this->project_analyzer, 1, false); $codebase->reloadFiles($this->project_analyzer, array_keys($analyzable_files + $vendor_files)); $codebase->analyzer->analyzeFiles($this->project_analyzer, 1, false); } }