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