private function findFileInPath($filename, $path)
    {
        $path = $this->absolutizePath($path);
        if (!file_exists($path)) {
            $this->fail("Directory does not exist: $path");
        }

        $files = Finder::create()->files()->name($filename)->in($path);
        if ($files->count() === 0) {
            return false;
        }

        foreach ($files as $file) {
            return $file->getRealPath();
        }
    }
private function findFileInPath($filename, $path)
    {
        $path = $this->absolutizePath($path);
        if (!file_exists($path)) {
            $this->fail("Directory does not exist: $path");
        }

        $files = Finder::create()->files()->name($filename)->in($path);
        if ($files->count() === 0) {
            return false;
        }

        foreach ($files as $file) {
            return $file->getRealPath();
        }
    }
private function findFileInPath ( $ filename , $ path ) { $ path = $ this -> absolutizePath ( $ path ) ; if ( ! file_exists ( $ path ) ) { $ this -> fail ( "Directory does not exist: $path" ) ; } $ files = Finder :: create ( ) -> files ( ) -> name ( $ filename ) -> in ( $ path ) ; if ( $ files -> count ( ) === 0 ) { return false ; } foreach ( $ files as $ file ) { return $ file -> getRealPath ( ) ; } }
Finds the first matching file

@param string $filename
@param string $path
@throws \PHPUnit\Framework\AssertionFailedError When path does not exist
@return string|false Path to the first matching file
Finds the first matching file