The unserialize() function will not always return an object
especially when as can happen the controller field of a
record in the backup_controllers table is empty.
This change ensures that in this case the script will
not cause a fatal error, but instead throw an error.
1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
Since deleting a course now triggers the pre_course_delete hook
it may be useful for hook implementations to know whether it was
a "true" course deletion, or one originating from a temporary
course created during a restore.
Now backup and restore operations free logger resources calling
to the destroy() method. This commit ensures:
1) That gc_collect_cycles() is not used anymore in backup-related tests.
2) That all backup and restore controllers in test do always call
to the detroy() method.
3) Some unset() calls, needed to make gc_collect_cycles() are not used
anymore.
Any backup & restore operation may be leaving opened files
if a file logger is being used. This implementes the close()
method, so every logger can close any resource.
Also, the recommended backup_controlled::destroy() method
now calls to new logger::destroy() method in charge of
deleting all the references and closing any resource.
Finally, some internally used controllers, were missing
their destroy call, leading to associated loggers to
remain open. Now all them are explicitly deltroyed.
General backup/restore does not need to handle external data sources natively - so
any changes needed to achieve this should be contained to the plugin that needs it.
In order to implement the backup and restore of log stores, that
are created as subplugins of the tool_log plugin , we need to
extend subplugins support from activities to virtually any plugin.
Basically that implies moving the add_subplugin_structure() method from
its current, restricted, activity level to general restore_structure_step.
This commit implements the change in restore, covered with tests verifying
old, bc behavior and also new, general one.
In order to implement the backup and restore of log stores, that
are created as subplugins of the tool_log plugin , we need to
extend subplugins support from activities to virtually any plugin.
Basically that implies moving the add_subplugin_structure() method from
its current, restricted, activity level to general backup_structure_step.
This commit implements the change in backup, covered with tests verifying
old, bc behavior and also new, general one.
This patch replaces all homegrown timezone
stuff with standard PHP date/time code.
The main change is the introduction of core_date
class that returns normalised user and server
timezones. From now on nobody should be using
$CFG->timezone or $user->timezone directly!
Other new features and fixes:
* admins are prompted for timezone during install
* editing of other users is finally fixed
* timezones are displayed in user profile
* new $this->setTimezone() in phpunit
* time locale is now automatically reset in phpunit
* timezone is now automatically reset in phpunit
* phpunit has Australia/Perth as default timezone