$files_to_check * @param array $files * * @return void */ public function testBasicRequire(array $files, array $files_to_check) { foreach ($files as $filename => $contents) { $this->project_checker->registerFile($filename, $contents); } foreach ($files_to_check as $filename) { $contents = $files[$filename]; $file_checker = new FileChecker($filename, $this->project_checker); $file_checker->visitAndAnalyzeMethods(); } } /** * @return array */ public function providerTestValidIncludes() { return [ 'basicRequire' => [ 'files' => [ getcwd() . DIRECTORY_SEPARATOR . 'file2.php' => ' ' [ getcwd() . DIRECTORY_SEPARATOR . 'file2.php', ], ], 'nestedRequire' => [ 'files' => [ getcwd() . DIRECTORY_SEPARATOR . 'file1.php' => ' ' 'fooFoo(); } }', ], 'files_to_check' => [ getcwd() . DIRECTORY_SEPARATOR . 'file3.php', ], ], 'requireNamespace' => [ 'files' => [ getcwd() . DIRECTORY_SEPARATOR . 'file1.php' => ' ' [ getcwd() . DIRECTORY_SEPARATOR . 'file2.php', ], ], 'requireFunction' => [ 'files' => [ getcwd() . DIRECTORY_SEPARATOR . 'file1.php' => ' ' [ getcwd() . DIRECTORY_SEPARATOR . 'file2.php', ], ], 'requireNamespacedWithUse' => [ 'files' => [ getcwd() . DIRECTORY_SEPARATOR . 'file1.php' => ' ' [ getcwd() . DIRECTORY_SEPARATOR . 'file2.php', ], ], 'noInfiniteRequireLoop' => [ 'files' => [ getcwd() . DIRECTORY_SEPARATOR . 'file1.php' => 'fooFoo(); } } class C {} new D();', getcwd() . DIRECTORY_SEPARATOR . 'file2.php' => ' ' [ getcwd() . DIRECTORY_SEPARATOR . 'file1.php', getcwd() . DIRECTORY_SEPARATOR . 'file2.php', getcwd() . DIRECTORY_SEPARATOR . 'file3.php', ], ], ]; } }