From 17d2e210b71f16b3d2e9a640098a1017aa540e36 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Fri, 13 May 2011 12:06:10 +0200 Subject: [PATCH] Renamed converter factory method to more self-descriptive get_converter() --- backup/converter/moodle1/simpletest/testlib.php | 12 ++++++------ backup/util/factories/convert_factory.class.php | 2 +- backup/util/helper/convert_helper.class.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backup/converter/moodle1/simpletest/testlib.php b/backup/converter/moodle1/simpletest/testlib.php index c72076b6214..03dbce67483 100644 --- a/backup/converter/moodle1/simpletest/testlib.php +++ b/backup/converter/moodle1/simpletest/testlib.php @@ -59,18 +59,18 @@ class moodle1_converter_test extends UnitTestCase { } public function test_convert_factory() { - $converter = convert_factory::converter('moodle1', $this->tempdir); + $converter = convert_factory::get_converter('moodle1', $this->tempdir); $this->assertIsA($converter, 'moodle1_converter'); } public function test_stash_storage_not_created() { - $converter = convert_factory::converter('moodle1', $this->tempdir); + $converter = convert_factory::get_converter('moodle1', $this->tempdir); $this->expectException('moodle1_convert_storage_exception'); $converter->set_stash('tempinfo', 12); } public function test_stash_requiring_empty_stash() { - $converter = convert_factory::converter('moodle1', $this->tempdir); + $converter = convert_factory::get_converter('moodle1', $this->tempdir); $converter->create_stash_storage(); $converter->set_stash('tempinfo', 12); $this->expectException('moodle1_convert_empty_storage_exception'); @@ -85,7 +85,7 @@ class moodle1_converter_test extends UnitTestCase { } public function test_stash_storage() { - $converter = convert_factory::converter('moodle1', $this->tempdir); + $converter = convert_factory::get_converter('moodle1', $this->tempdir); $converter->create_stash_storage(); // test stashes without itemid @@ -112,7 +112,7 @@ class moodle1_converter_test extends UnitTestCase { } public function test_get_contextid() { - $converter = convert_factory::converter('moodle1', $this->tempdir); + $converter = convert_factory::get_converter('moodle1', $this->tempdir); // stash storage must be created in advance $converter->create_stash_storage(); @@ -135,7 +135,7 @@ class moodle1_converter_test extends UnitTestCase { } public function test_convert_run_convert() { - $converter = convert_factory::converter('moodle1', $this->tempdir); + $converter = convert_factory::get_converter('moodle1', $this->tempdir); $converter->convert(); } } diff --git a/backup/util/factories/convert_factory.class.php b/backup/util/factories/convert_factory.class.php index c02825b04a1..485e8318479 100644 --- a/backup/util/factories/convert_factory.class.php +++ b/backup/util/factories/convert_factory.class.php @@ -37,7 +37,7 @@ abstract class convert_factory { * @param $tempdir The temp directory to operate on * @return base_converter */ - public static function converter($name, $tempdir) { + public static function get_converter($name, $tempdir) { global $CFG; $name = clean_param($name, PARAM_SAFEDIR); diff --git a/backup/util/helper/convert_helper.class.php b/backup/util/helper/convert_helper.class.php index 51488aebb31..7ece78200f0 100644 --- a/backup/util/helper/convert_helper.class.php +++ b/backup/util/helper/convert_helper.class.php @@ -143,7 +143,7 @@ abstract class convert_helper { } foreach ($path as $name) { - $converter = convert_factory::converter($name, $tempdir); + $converter = convert_factory::get_converter($name, $tempdir); $converter->convert(); }