From 510377d2cb4b12d1a421e8a88bd7edb86f223451 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 12 Jan 2016 19:50:48 +0100 Subject: Introduce the Updater class which * contains methods designed to be run once. * is able to upgrade the datastore or the configuration. * is based on methods names, stored in a text file with ';' separator (updates.txt). * begins with existing function 'mergeDeprecatedConfigFile()' (options.php). --- tests/Updater/DummyUpdater.php | 68 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tests/Updater/DummyUpdater.php (limited to 'tests/Updater/DummyUpdater.php') diff --git a/tests/Updater/DummyUpdater.php b/tests/Updater/DummyUpdater.php new file mode 100644 index 00000000..e9ef2aaa --- /dev/null +++ b/tests/Updater/DummyUpdater.php @@ -0,0 +1,68 @@ +methods = $class->getMethods(ReflectionMethod::IS_FINAL); + } + + /** + * Update method 1. + * + * @return bool true. + */ + private final function updateMethodDummy1() + { + return true; + } + + /** + * Update method 2. + * + * @return bool true. + */ + private final function updateMethodDummy2() + { + return true; + } + + /** + * Update method 3. + * + * @return bool true. + */ + private final function updateMethodDummy3() + { + return true; + } + + /** + * Update method 4, raise an exception. + * + * @throws Exception error. + */ + private final function updateMethodException() + { + throw new Exception('whatever'); + } +} -- cgit v1.2.3