MDL-35238 Introduce available_update_deployer class

This class represents the communication bridge from Moodle UI to the
(standalone) mdeploy.php utility. It consists of various helper methods
useful when dealing with user interface, update confirmation etc.

The class is implemented as a singleton. This allows us easily
transfer required data from top level scripts (like /admin/index.php)
into the rendering methods deep in the stack without the need to change
the API of many methods on the way.
This commit is contained in:
David Mudrák
2012-11-08 22:33:06 +01:00
parent f965e16539
commit 7683e550ac
3 changed files with 343 additions and 0 deletions
+14
View File
@@ -543,3 +543,17 @@ class testable_available_update_checker extends available_update_checker {
class testable_available_update_checker_cron_executed extends Exception {
}
/**
* Test cases for {@link available_update_deployer} class
*/
class available_update_deployer_test extends advanced_testcase {
public function test_magic_setters() {
$deployer = available_update_deployer::instance();
$value = new moodle_url('/');
$deployer->set_returnurl($value);
$this->assertSame($deployer->get_returnurl(), $value);
}
}