aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Updater/DummyUpdater.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-12-03 23:49:20 +0100
committerVirtualTam <virtualtam@flibidi.net>2019-01-12 23:11:19 +0100
commitbcf056c9d92e5240e645c76a4cdc8ae159693f9a (patch)
tree3991d2e0703276474a3fa5b0f3cccc63b2e74f19 /tests/Updater/DummyUpdater.php
parent92c6439dbc41d8a2873dfebbc44e30d75c0c473d (diff)
downloadShaarli-bcf056c9d92e5240e645c76a4cdc8ae159693f9a.tar.gz
Shaarli-bcf056c9d92e5240e645c76a4cdc8ae159693f9a.tar.zst
Shaarli-bcf056c9d92e5240e645c76a4cdc8ae159693f9a.zip
namespacing: \Shaarli\Updater
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests/Updater/DummyUpdater.php')
-rw-r--r--tests/Updater/DummyUpdater.php70
1 files changed, 0 insertions, 70 deletions
diff --git a/tests/Updater/DummyUpdater.php b/tests/Updater/DummyUpdater.php
deleted file mode 100644
index 3c74b4ff..00000000
--- a/tests/Updater/DummyUpdater.php
+++ /dev/null
@@ -1,70 +0,0 @@
1<?php
2
3use Shaarli\Bookmark\LinkDB;
4
5require_once 'application/Updater.php';
6
7/**
8 * Class DummyUpdater.
9 * Extends Updater to add update method designed for unit tests.
10 */
11class DummyUpdater extends Updater
12{
13 /**
14 * Object constructor.
15 *
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.
20 */
21 public function __construct($doneUpdates, $linkDB, $conf, $isLoggedIn)
22 {
23 parent::__construct($doneUpdates, $linkDB, $conf, $isLoggedIn);
24
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);
29 }
30
31 /**
32 * Update method 1.
33 *
34 * @return bool true.
35 */
36 final private function updateMethodDummy1()
37 {
38 return true;
39 }
40
41 /**
42 * Update method 2.
43 *
44 * @return bool true.
45 */
46 final private function updateMethodDummy2()
47 {
48 return true;
49 }
50
51 /**
52 * Update method 3.
53 *
54 * @return bool true.
55 */
56 final private function updateMethodDummy3()
57 {
58 return true;
59 }
60
61 /**
62 * Update method 4, raise an exception.
63 *
64 * @throws Exception error.
65 */
66 final private function updateMethodException()
67 {
68 throw new Exception('whatever');
69 }
70}