aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Updater
diff options
context:
space:
mode:
authorAurélien Tamisier <virtualtam+github@flibidi.net>2018-12-02 22:47:41 +0100
committerGitHub <noreply@github.com>2018-12-02 22:47:41 +0100
commit1004742f09b55ff781c13745781b9a7e90986faa (patch)
treeaa0e5743390296441edf09f44f95b3d21f2b5a16 /tests/Updater
parent5e0a898bb13fad528514b0d33763bcaae38b45b0 (diff)
parent9d9f6d75b94aab51067bdfbe50b58b66d1194f6d (diff)
downloadShaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.gz
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.zst
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.zip
Merge pull request #1234 from virtualtam/lint
Setup PHPCS and cleanup linter configuration
Diffstat (limited to 'tests/Updater')
-rw-r--r--tests/Updater/DummyUpdater.php8
-rw-r--r--tests/Updater/UpdaterTest.php20
2 files changed, 20 insertions, 8 deletions
diff --git a/tests/Updater/DummyUpdater.php b/tests/Updater/DummyUpdater.php
index a0be4413..a805ab5e 100644
--- a/tests/Updater/DummyUpdater.php
+++ b/tests/Updater/DummyUpdater.php
@@ -31,7 +31,7 @@ class DummyUpdater extends Updater
31 * 31 *
32 * @return bool true. 32 * @return bool true.
33 */ 33 */
34 private final function updateMethodDummy1() 34 final private function updateMethodDummy1()
35 { 35 {
36 return true; 36 return true;
37 } 37 }
@@ -41,7 +41,7 @@ class DummyUpdater extends Updater
41 * 41 *
42 * @return bool true. 42 * @return bool true.
43 */ 43 */
44 private final function updateMethodDummy2() 44 final private function updateMethodDummy2()
45 { 45 {
46 return true; 46 return true;
47 } 47 }
@@ -51,7 +51,7 @@ class DummyUpdater extends Updater
51 * 51 *
52 * @return bool true. 52 * @return bool true.
53 */ 53 */
54 private final function updateMethodDummy3() 54 final private function updateMethodDummy3()
55 { 55 {
56 return true; 56 return true;
57 } 57 }
@@ -61,7 +61,7 @@ class DummyUpdater extends Updater
61 * 61 *
62 * @throws Exception error. 62 * @throws Exception error.
63 */ 63 */
64 private final function updateMethodException() 64 final private function updateMethodException()
65 { 65 {
66 throw new Exception('whatever'); 66 throw new Exception('whatever');
67 } 67 }
diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php
index 870f169a..c4a6e7ef 100644
--- a/tests/Updater/UpdaterTest.php
+++ b/tests/Updater/UpdaterTest.php
@@ -393,20 +393,32 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
393 $this->assertEquals('Naming conventions... #private', $linkDB[0]['description']); 393 $this->assertEquals('Naming conventions... #private', $linkDB[0]['description']);
394 $this->assertEquals('samba cartoon web', $linkDB[0]['tags']); 394 $this->assertEquals('samba cartoon web', $linkDB[0]['tags']);
395 $this->assertTrue($linkDB[0]['private']); 395 $this->assertTrue($linkDB[0]['private']);
396 $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_142300'), $linkDB[0]['created']); 396 $this->assertEquals(
397 DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_142300'),
398 $linkDB[0]['created']
399 );
397 400
398 $this->assertTrue(isset($linkDB[1])); 401 $this->assertTrue(isset($linkDB[1]));
399 $this->assertFalse(isset($linkDB[1]['linkdate'])); 402 $this->assertFalse(isset($linkDB[1]['linkdate']));
400 $this->assertEquals(1, $linkDB[1]['id']); 403 $this->assertEquals(1, $linkDB[1]['id']);
401 $this->assertEquals('UserFriendly - Samba', $linkDB[1]['title']); 404 $this->assertEquals('UserFriendly - Samba', $linkDB[1]['title']);
402 $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_172539'), $linkDB[1]['created']); 405 $this->assertEquals(
406 DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_172539'),
407 $linkDB[1]['created']
408 );
403 409
404 $this->assertTrue(isset($linkDB[2])); 410 $this->assertTrue(isset($linkDB[2]));
405 $this->assertFalse(isset($linkDB[2]['linkdate'])); 411 $this->assertFalse(isset($linkDB[2]['linkdate']));
406 $this->assertEquals(2, $linkDB[2]['id']); 412 $this->assertEquals(2, $linkDB[2]['id']);
407 $this->assertEquals('Geek and Poke', $linkDB[2]['title']); 413 $this->assertEquals('Geek and Poke', $linkDB[2]['title']);
408 $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_182539'), $linkDB[2]['created']); 414 $this->assertEquals(
409 $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_190301'), $linkDB[2]['updated']); 415 DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_182539'),
416 $linkDB[2]['created']
417 );
418 $this->assertEquals(
419 DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_190301'),
420 $linkDB[2]['updated']
421 );
410 } 422 }
411 423
412 /** 424 /**