2 namespace Shaarli\Updater
;
7 use Shaarli\Bookmark\LinkDB
;
8 use Shaarli\Config\ConfigManager
;
12 * Extends updater to add update method designed for unit tests.
14 class DummyUpdater
extends Updater
19 * @param array $doneUpdates Updates which are already done.
20 * @param LinkDB $linkDB LinkDB instance.
21 * @param ConfigManager $conf Configuration Manager instance.
22 * @param boolean $isLoggedIn True if the user is logged in.
24 public function __construct($doneUpdates, $linkDB, $conf, $isLoggedIn)
26 parent
::__construct($doneUpdates, $linkDB, $conf, $isLoggedIn);
28 // Retrieve all update methods.
29 // For unit test, only retrieve final methods,
30 $class = new ReflectionClass($this);
31 $this->methods
= $class->getMethods(ReflectionMethod
::IS_FINAL
);
39 final private function updateMethodDummy1()
49 final private function updateMethodDummy2()
59 final private function updateMethodDummy3()
65 * Update method 4, raise an exception.
67 * @throws Exception error.
69 final private function updateMethodException()
71 throw new Exception('whatever');