Created a new phpunit util function run_all_adhoc_tasks which runs any
pending tasks, for use in unit tests. Added new recyclebin and course
unit tests covering the new functionality.
Changed the course libs such that module and section deletion is now
handed off to relevant functions in the util class and exempted
modules scheduled for deletion from the course backups.
Fix I edit profile steps
Apply fixed header in css
Remove transitions from menus for behat
Be more specific about some "I follow" steps
Navigation path changes
"Current course" node removed from nav tree
Adapt tests because there are no default blocks
Force some space between action menu items
dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
One of the unit tests for tool_recyclebin makes an assumption that a
fresh install of Moodle has no course modules, which is true for vanilla
moodle.
However there are some third party plugins (mod_oublog and
mod_respondusws are the ones I've run into) that have a course module
added to the frontpage course on install.
So this change alters the test from comparing the count of modules in
the test course with a hardcoded value to first getting the existing
count of values before performing the actions that affect the count and
then using that value to compare with.
- Added new icon for the recycle bin.
- Fixed issue where the course expiry setting was being used to display
the expiry messages in the category bin.
- Fixed failing Behat tests.
- Tidied Behat tests.
- General tidy up.
- Deleted three Behat feature files.
- Deleted 'delete_confirmation.feature' as it's testing JS functionality
that was removed (see comment further down). The 'basic_functionality.feature'
now tests deleting an activity and a course.
- Deleted 'description.feature' and added the tested functionality to
'basic_functionality.feature'.
- Deleted 'logs_test.feature' and moved testing to PHPUnit tests.
- Added another scenario for restoring a course.
- Removed protected mod settings - it was discussed that this was not a necessary
feature. We should not be treating the recycle bin as a backup.
- Renamed events to conform to guidelines.
- Wrote new PHPUnit tests for events.
- Tidied up existing PHPUnit tests and extended them.
- Alphabetised lang file.
- Made changes to strings and string identifiers in the lang file and changed usages in code.
- Changed setting names to better identify their purpose.
- Renamed classes and file names so it's easier to identify their purpose.
- Renamed the 'deleted' column to 'timecreated' for consistency with other
Moodle tables, and to easily identify what the value represents.
- Changed the columns 'category' and 'course' to 'categoryid' and
'courseid' respectively.
- Changed the name of the table indexes for consistency with core.
- Removed module.js and any use of it and replaced with Moodle core libraries
for JS confirmation.
- Removed 'noevent' argument in delete_item().
- Removed unnecessary capabilities - we can use the same capabilties for both
recycle bins based on the context the capability was given.
- Removed '_' in the capability definitions to keep it consistent with core.
- Set page layout and headings for index.php - varies between the course and
category recycle bins.
- Deleted styles.css and centred columns using the flexible_table API.
- Fixed IDE and codechecker complaints.
- Made use of the files API, rather than writing directly to
"$CFG->dataroot . '/recyclebin'".
- Used make_temp_directory rather than expecting it to exist.
- Replaced debugging function calls with calls to the backup API to
display errors.
- Deleted the temporary backup file after a successful restore, or if it fails.
- If the restore fails for a course, delete the course we created.
- Removed unnecessary '\' characters when not in namespace.
- Used configduration class for expiry times in the settings.
- Cleanup course bin when a course is deleted.
- Cleanup a category bin when a category is deleted.
- Removed unnecessary throw tags.
- Changed default settings.