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

Move file-system specific components of file_storage and stored_file to new overridable API

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Automated testing

      1. Behat
      2. PHPUnit

      Manual testing

      Whilst testing, I'd recommend tailing your web server's error logs.

      General testing

      1. Perform a smoke test of Moodle

      Targetted testing

      Note: Each time you upload a file, please upload a mixture of files which are new to your site, and some which may already exist

      Private files
      1. Login as an editing teacher
      2. Navigate to your private files
      3. Upload two files using drag/drop - one image, and one other file type
        1. Confirm that a preview was generated for the image
      4. Download each file back from Moodle
        1. Confirm that they are present and correct
      5. Download all files as a zip
        1. Confirm that they are present and correct
      6. Save changes
        1. Confirm that the files are still present in your private files
      7. Delete the files
      8. Using a repository (perhaps Dropbox?), copy two files (one image, one other)
        1. Confirm that a preview was generated for the image
      9. Download each file back from Moodle
        1. Confirm that they are present and correct
      10. Download all files as a zip
        1. Confirm that they are present and correct
      11. Save changes
        1. Confirm that the files are still present in your private files
      12. Delete the files
      13. Using a repository which supports references (perhaps Dropbox?), reference two files (one image, one other)
        1. Confirm that a preview was generated for the image
      14. Download each file back from Moodle
        1. Confirm that they are present and correct
      15. Download all files as a zip
        1. Confirm that they are present and correct
      16. Save changes
        1. Confirm that the files are still present in your private files
      17. Delete the files
      Course files
      1. Navigate to a course
      2. Edit the course
        1. Upload an image to the Course summary files
        2. Save changes
        3. Confirm that the file appears in the Dashboard / Site Home
      3. Turn editing on
      4. Drag/drop two images into the course - embed one (Add media) and link the other (Create file resource)
        1. Confirm that you can view both
      5. Upload a non-image file
        1. Confirm that you can view it within the course
      6. Edit the settings for all three files
        1. Confirm that in the Select files area, you can see the preview and download the file
      7. Create a forum
      8. Create a forum post which has:
        1. an embedded image; and
        2. some attachments (image and other).
      9. Confirm that when viewing them you can still see them
      10. Create an assignment
      11. Upload a PDF
      12. View the PDF in editpdf, make some notes, and save.
        1. Confirm that the updated PDF is available to students
      Course backup & Restore
      1. Navigate to your course
      2. Duplicate an activity
        1. Confirm that the new activity works as expected
      3. Backup your course using default settings
        1. Confirm that you were able to backup the course
      4. Navigate to your course's Restore page
      5. Click the Restore link beside the backup you just took and complete the process into a new course
        1. Confirm that you were able to restore the course
      6. Download the backup
      7. Re-upload it into the Import a backup file and complete the restoration process into a new course
        1. Confirm that you were able to restore the course
      Show
      Automated testing Behat PHPUnit Manual testing Whilst testing, I'd recommend tailing your web server's error logs. General testing Perform a smoke test of Moodle Targetted testing Note: Each time you upload a file, please upload a mixture of files which are new to your site, and some which may already exist Private files Login as an editing teacher Navigate to your private files Upload two files using drag/drop - one image, and one other file type Confirm that a preview was generated for the image Download each file back from Moodle Confirm that they are present and correct Download all files as a zip Confirm that they are present and correct Save changes Confirm that the files are still present in your private files Delete the files Using a repository (perhaps Dropbox?), copy two files (one image, one other) Confirm that a preview was generated for the image Download each file back from Moodle Confirm that they are present and correct Download all files as a zip Confirm that they are present and correct Save changes Confirm that the files are still present in your private files Delete the files Using a repository which supports references (perhaps Dropbox?), reference two files (one image, one other) Confirm that a preview was generated for the image Download each file back from Moodle Confirm that they are present and correct Download all files as a zip Confirm that they are present and correct Save changes Confirm that the files are still present in your private files Delete the files Course files Navigate to a course Edit the course Upload an image to the Course summary files Save changes Confirm that the file appears in the Dashboard / Site Home Turn editing on Drag/drop two images into the course - embed one (Add media) and link the other (Create file resource) Confirm that you can view both Upload a non-image file Confirm that you can view it within the course Edit the settings for all three files Confirm that in the Select files area, you can see the preview and download the file Create a forum Create a forum post which has: an embedded image; and some attachments (image and other). Confirm that when viewing them you can still see them Create an assignment Upload a PDF View the PDF in editpdf, make some notes, and save. Confirm that the updated PDF is available to students Course backup & Restore Navigate to your course Duplicate an activity Confirm that the new activity works as expected Backup your course using default settings Confirm that you were able to backup the course Navigate to your course's Restore page Click the Restore link beside the backup you just took and complete the process into a new course Confirm that you were able to restore the course Download the backup Re-upload it into the Import a backup file and complete the restoration process into a new course Confirm that you were able to restore the course
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-46375-master-wip

      Description

      Update the file_storage, and stored_file classes to move all real file operations to a new file_system class.
      The file_system class should be fully functional on it's own, but overridable such that any file operation can be replaced with an alternative file system (e.g. S3, Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).

      I've also taken the liberty of moving all of this to its own namespace such that it supports autoloading.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                23 Vote for this issue
                Watchers:
                40 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/17