Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-83034

Find a way to verify the extension of a downloaded file in Behat

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE

      This is a follow-up from MDL-63399.

      While working on that improvement I noticed that in most cases it's not possible to validate the file extension using php finfo class:

      $finfo = new finfo(FILEINFO_EXTENSION);
      $actualextension = $finfo->buffer($filecontent); 

      In most xml and text files in moodle the actual extension will return '???' causing Behat to fail:

      The file downloaded should have been a txt file, but got ??? instead. (Behat\Mink\Exception\ExpectationException)
      

            Unassigned Unassigned
            lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.