diff options
author | VirtualTam <tamisier.aurelien@gmail.com> | 2015-07-10 17:43:00 +0200 |
---|---|---|
committer | VirtualTam <tamisier.aurelien@gmail.com> | 2015-07-10 17:43:00 +0200 |
commit | 49ca75695019865a3c57323a1d5c3c8c62ca124f (patch) | |
tree | 22fc07bc69a7c5b8ecf926b129b0d90bd91b78f1 /tests | |
parent | e92f1ba59edb9fd60b185dc633e64a62dffe3b04 (diff) | |
parent | 07b6fa750ba1dc1b7d8c22959b3528f4c9b9ab85 (diff) | |
download | Shaarli-49ca75695019865a3c57323a1d5c3c8c62ca124f.tar.gz Shaarli-49ca75695019865a3c57323a1d5c3c8c62ca124f.tar.zst Shaarli-49ca75695019865a3c57323a1d5c3c8c62ca124f.zip |
Merge pull request #267 from virtualtam/linkdb/private-names
LinkDB: prefix private members with an underscore
Diffstat (limited to 'tests')
-rw-r--r-- | tests/LinkDBTest.php | 4 | ||||
-rw-r--r-- | tests/utils/ReferenceLinkDB.php | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index 8b0bd23b..d34ea4f5 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php | |||
@@ -103,7 +103,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
103 | unlink(self::$testDatastore); | 103 | unlink(self::$testDatastore); |
104 | $this->assertFileNotExists(self::$testDatastore); | 104 | $this->assertFileNotExists(self::$testDatastore); |
105 | 105 | ||
106 | $checkDB = self::getMethod('checkDB'); | 106 | $checkDB = self::getMethod('_checkDB'); |
107 | $checkDB->invokeArgs($linkDB, array()); | 107 | $checkDB->invokeArgs($linkDB, array()); |
108 | $this->assertFileExists(self::$testDatastore); | 108 | $this->assertFileExists(self::$testDatastore); |
109 | 109 | ||
@@ -120,7 +120,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
120 | $datastoreSize = filesize(self::$testDatastore); | 120 | $datastoreSize = filesize(self::$testDatastore); |
121 | $this->assertGreaterThan(0, $datastoreSize); | 121 | $this->assertGreaterThan(0, $datastoreSize); |
122 | 122 | ||
123 | $checkDB = self::getMethod('checkDB'); | 123 | $checkDB = self::getMethod('_checkDB'); |
124 | $checkDB->invokeArgs($linkDB, array()); | 124 | $checkDB->invokeArgs($linkDB, array()); |
125 | 125 | ||
126 | // ensure the datastore is left unmodified | 126 | // ensure the datastore is left unmodified |
diff --git a/tests/utils/ReferenceLinkDB.php b/tests/utils/ReferenceLinkDB.php index 59ba671f..0b225720 100644 --- a/tests/utils/ReferenceLinkDB.php +++ b/tests/utils/ReferenceLinkDB.php | |||
@@ -4,9 +4,9 @@ | |||
4 | */ | 4 | */ |
5 | class ReferenceLinkDB | 5 | class ReferenceLinkDB |
6 | { | 6 | { |
7 | private $links = array(); | 7 | private $_links = array(); |
8 | private $publicCount = 0; | 8 | private $_publicCount = 0; |
9 | private $privateCount = 0; | 9 | private $_privateCount = 0; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * Populates the test DB with reference data | 12 | * Populates the test DB with reference data |
@@ -81,13 +81,13 @@ class ReferenceLinkDB | |||
81 | 'linkdate' => $date, | 81 | 'linkdate' => $date, |
82 | 'tags' => $tags, | 82 | 'tags' => $tags, |
83 | ); | 83 | ); |
84 | $this->links[$date] = $link; | 84 | $this->_links[$date] = $link; |
85 | 85 | ||
86 | if ($private) { | 86 | if ($private) { |
87 | $this->privateCount++; | 87 | $this->_privateCount++; |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | $this->publicCount++; | 90 | $this->_publicCount++; |
91 | } | 91 | } |
92 | 92 | ||
93 | /** | 93 | /** |
@@ -97,7 +97,7 @@ class ReferenceLinkDB | |||
97 | { | 97 | { |
98 | file_put_contents( | 98 | file_put_contents( |
99 | $filename, | 99 | $filename, |
100 | '<?php /* '.base64_encode(gzdeflate(serialize($this->links))).' */ ?>' | 100 | '<?php /* '.base64_encode(gzdeflate(serialize($this->_links))).' */ ?>' |
101 | ); | 101 | ); |
102 | } | 102 | } |
103 | 103 | ||
@@ -106,7 +106,7 @@ class ReferenceLinkDB | |||
106 | */ | 106 | */ |
107 | public function countLinks() | 107 | public function countLinks() |
108 | { | 108 | { |
109 | return $this->publicCount + $this->privateCount; | 109 | return $this->_publicCount + $this->_privateCount; |
110 | } | 110 | } |
111 | 111 | ||
112 | /** | 112 | /** |
@@ -114,7 +114,7 @@ class ReferenceLinkDB | |||
114 | */ | 114 | */ |
115 | public function countPublicLinks() | 115 | public function countPublicLinks() |
116 | { | 116 | { |
117 | return $this->publicCount; | 117 | return $this->_publicCount; |
118 | } | 118 | } |
119 | 119 | ||
120 | /** | 120 | /** |
@@ -122,7 +122,7 @@ class ReferenceLinkDB | |||
122 | */ | 122 | */ |
123 | public function countPrivateLinks() | 123 | public function countPrivateLinks() |
124 | { | 124 | { |
125 | return $this->privateCount; | 125 | return $this->_privateCount; |
126 | } | 126 | } |
127 | } | 127 | } |
128 | ?> | 128 | ?> |