2 namespace Shaarli\Updater
;
7 use Shaarli\Config\ConfigManager
;
8 use Shaarli\Legacy\LegacyLinkDB
;
9 use Shaarli\Legacy\LegacyUpdater
;
12 * Class LegacyDummyUpdater.
13 * Extends updater to add update method designed for unit tests.
15 class LegacyDummyUpdater
extends LegacyUpdater
20 * @param array $doneUpdates Updates which are already done.
21 * @param LegacyLinkDB $linkDB LinkDB instance.
22 * @param ConfigManager $conf Configuration Manager instance.
23 * @param boolean $isLoggedIn True if the user is logged in.
25 public function __construct($doneUpdates, $linkDB, $conf, $isLoggedIn)
27 parent
::__construct($doneUpdates, $linkDB, $conf, $isLoggedIn);
29 // Retrieve all update methods.
30 // For unit test, only retrieve final methods,
31 $class = new ReflectionClass($this);
32 $this->methods
= $class->getMethods(ReflectionMethod
::IS_FINAL
);
40 final private function updateMethodDummy1()
50 final private function updateMethodDummy2()
60 final private function updateMethodDummy3()
66 * Update method 4, raise an exception.
68 * @throws Exception error.
70 final private function updateMethodException()
72 throw new Exception('whatever');