2 namespace Shaarli\Updater
;
7 use Shaarli\Bookmark\BookmarkFileService
;
8 use Shaarli\Bookmark\LinkDB
;
9 use Shaarli\Config\ConfigManager
;
13 * Extends updater to add update method designed for unit tests.
15 class DummyUpdater
extends Updater
20 * @param array $doneUpdates Updates which are already done.
21 * @param BookmarkFileService $bookmarkService 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, $bookmarkService, $conf, $isLoggedIn)
27 parent
::__construct($doneUpdates, $bookmarkService, $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');