aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-11-10 10:46:04 +0100
committerGitHub <noreply@github.com>2020-11-10 10:46:04 +0100
commit302662797cb5e8ac6579a99297ceae301f7927a6 (patch)
tree67f493a1cc6d3691742946f1d7e512bffe41e02f /tests
parentc94c32d1a3e86a479cb2582eadc668a5bb476fc6 (diff)
parent2f4df753041088d788d1923692a7d530167a6840 (diff)
downloadShaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.gz
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.zst
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.zip
Merge pull request #1635 from ArthurHoaro/feature/phpcs
Diffstat (limited to 'tests')
-rw-r--r--tests/legacy/LegacyUpdaterTest.php16
-rw-r--r--tests/updater/UpdaterTest.php16
2 files changed, 16 insertions, 16 deletions
diff --git a/tests/legacy/LegacyUpdaterTest.php b/tests/legacy/LegacyUpdaterTest.php
index f7391b86..395dd4b7 100644
--- a/tests/legacy/LegacyUpdaterTest.php
+++ b/tests/legacy/LegacyUpdaterTest.php
@@ -51,10 +51,10 @@ class LegacyUpdaterTest extends \Shaarli\TestCase
51 */ 51 */
52 public function testReadEmptyUpdatesFile() 52 public function testReadEmptyUpdatesFile()
53 { 53 {
54 $this->assertEquals(array(), UpdaterUtils::read_updates_file('')); 54 $this->assertEquals(array(), UpdaterUtils::readUpdatesFile(''));
55 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; 55 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt';
56 touch($updatesFile); 56 touch($updatesFile);
57 $this->assertEquals(array(), UpdaterUtils::read_updates_file($updatesFile)); 57 $this->assertEquals(array(), UpdaterUtils::readUpdatesFile($updatesFile));
58 unlink($updatesFile); 58 unlink($updatesFile);
59 } 59 }
60 60
@@ -66,14 +66,14 @@ class LegacyUpdaterTest extends \Shaarli\TestCase
66 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; 66 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt';
67 $updatesMethods = array('m1', 'm2', 'm3'); 67 $updatesMethods = array('m1', 'm2', 'm3');
68 68
69 UpdaterUtils::write_updates_file($updatesFile, $updatesMethods); 69 UpdaterUtils::writeUpdatesFile($updatesFile, $updatesMethods);
70 $readMethods = UpdaterUtils::read_updates_file($updatesFile); 70 $readMethods = UpdaterUtils::readUpdatesFile($updatesFile);
71 $this->assertEquals($readMethods, $updatesMethods); 71 $this->assertEquals($readMethods, $updatesMethods);
72 72
73 // Update 73 // Update
74 $updatesMethods[] = 'm4'; 74 $updatesMethods[] = 'm4';
75 UpdaterUtils::write_updates_file($updatesFile, $updatesMethods); 75 UpdaterUtils::writeUpdatesFile($updatesFile, $updatesMethods);
76 $readMethods = UpdaterUtils::read_updates_file($updatesFile); 76 $readMethods = UpdaterUtils::readUpdatesFile($updatesFile);
77 $this->assertEquals($readMethods, $updatesMethods); 77 $this->assertEquals($readMethods, $updatesMethods);
78 unlink($updatesFile); 78 unlink($updatesFile);
79 } 79 }
@@ -86,7 +86,7 @@ class LegacyUpdaterTest extends \Shaarli\TestCase
86 $this->expectException(\Exception::class); 86 $this->expectException(\Exception::class);
87 $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); 87 $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/');
88 88
89 UpdaterUtils::write_updates_file('', array('test')); 89 UpdaterUtils::writeUpdatesFile('', array('test'));
90 } 90 }
91 91
92 /** 92 /**
@@ -101,7 +101,7 @@ class LegacyUpdaterTest extends \Shaarli\TestCase
101 touch($updatesFile); 101 touch($updatesFile);
102 chmod($updatesFile, 0444); 102 chmod($updatesFile, 0444);
103 try { 103 try {
104 @UpdaterUtils::write_updates_file($updatesFile, array('test')); 104 @UpdaterUtils::writeUpdatesFile($updatesFile, array('test'));
105 } catch (Exception $e) { 105 } catch (Exception $e) {
106 unlink($updatesFile); 106 unlink($updatesFile);
107 throw $e; 107 throw $e;
diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php
index 47332544..cadd8265 100644
--- a/tests/updater/UpdaterTest.php
+++ b/tests/updater/UpdaterTest.php
@@ -60,10 +60,10 @@ class UpdaterTest extends TestCase
60 */ 60 */
61 public function testReadEmptyUpdatesFile() 61 public function testReadEmptyUpdatesFile()
62 { 62 {
63 $this->assertEquals(array(), UpdaterUtils::read_updates_file('')); 63 $this->assertEquals(array(), UpdaterUtils::readUpdatesFile(''));
64 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; 64 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt';
65 touch($updatesFile); 65 touch($updatesFile);
66 $this->assertEquals(array(), UpdaterUtils::read_updates_file($updatesFile)); 66 $this->assertEquals(array(), UpdaterUtils::readUpdatesFile($updatesFile));
67 unlink($updatesFile); 67 unlink($updatesFile);
68 } 68 }
69 69
@@ -75,14 +75,14 @@ class UpdaterTest extends TestCase
75 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; 75 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt';
76 $updatesMethods = array('m1', 'm2', 'm3'); 76 $updatesMethods = array('m1', 'm2', 'm3');
77 77
78 UpdaterUtils::write_updates_file($updatesFile, $updatesMethods); 78 UpdaterUtils::writeUpdatesFile($updatesFile, $updatesMethods);
79 $readMethods = UpdaterUtils::read_updates_file($updatesFile); 79 $readMethods = UpdaterUtils::readUpdatesFile($updatesFile);
80 $this->assertEquals($readMethods, $updatesMethods); 80 $this->assertEquals($readMethods, $updatesMethods);
81 81
82 // Update 82 // Update
83 $updatesMethods[] = 'm4'; 83 $updatesMethods[] = 'm4';
84 UpdaterUtils::write_updates_file($updatesFile, $updatesMethods); 84 UpdaterUtils::writeUpdatesFile($updatesFile, $updatesMethods);
85 $readMethods = UpdaterUtils::read_updates_file($updatesFile); 85 $readMethods = UpdaterUtils::readUpdatesFile($updatesFile);
86 $this->assertEquals($readMethods, $updatesMethods); 86 $this->assertEquals($readMethods, $updatesMethods);
87 unlink($updatesFile); 87 unlink($updatesFile);
88 } 88 }
@@ -95,7 +95,7 @@ class UpdaterTest extends TestCase
95 $this->expectException(\Exception::class); 95 $this->expectException(\Exception::class);
96 $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); 96 $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/');
97 97
98 UpdaterUtils::write_updates_file('', array('test')); 98 UpdaterUtils::writeUpdatesFile('', array('test'));
99 } 99 }
100 100
101 /** 101 /**
@@ -110,7 +110,7 @@ class UpdaterTest extends TestCase
110 touch($updatesFile); 110 touch($updatesFile);
111 chmod($updatesFile, 0444); 111 chmod($updatesFile, 0444);
112 try { 112 try {
113 @UpdaterUtils::write_updates_file($updatesFile, array('test')); 113 @UpdaterUtils::writeUpdatesFile($updatesFile, array('test'));
114 } catch (Exception $e) { 114 } catch (Exception $e) {
115 unlink($updatesFile); 115 unlink($updatesFile);
116 throw $e; 116 throw $e;