]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - tests/Updater/DummyUpdater.php
3 use Shaarli\Bookmark\LinkDB
;
5 require_once 'application/Updater.php';
9 * Extends Updater to add update method designed for unit tests.
11 class DummyUpdater
extends Updater
16 * @param array $doneUpdates Updates which are already done.
17 * @param LinkDB $linkDB LinkDB instance.
18 * @param ConfigManager $conf Configuration Manager instance.
19 * @param boolean $isLoggedIn True if the user is logged in.
21 public function __construct($doneUpdates, $linkDB, $conf, $isLoggedIn)
23 parent
::__construct($doneUpdates, $linkDB, $conf, $isLoggedIn);
25 // Retrieve all update methods.
26 // For unit test, only retrieve final methods,
27 $class = new ReflectionClass($this);
28 $this->methods
= $class->getMethods(ReflectionMethod
::IS_FINAL
);
36 final private function updateMethodDummy1()
46 final private function updateMethodDummy2()
56 final private function updateMethodDummy3()
62 * Update method 4, raise an exception.
64 * @throws Exception error.
66 final private function updateMethodException()
68 throw new Exception('whatever');