aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/utils/ReferenceLinkDB.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2017-08-23 01:08:41 +0200
committerVirtualTam <virtualtam@flibidi.net>2017-08-23 01:08:41 +0200
commit9d7a02afcee3c740712a7c95182d332db0504b7e (patch)
tree3266e3d3bfec6a3ac075084cbec07ba4090c4cd2 /tests/utils/ReferenceLinkDB.php
parentc318096c7a6fb3f6b00bd8c694ab7acb8fbb7cd0 (diff)
parent7c2460c856c1d561b8347316f3045208f9f3d24e (diff)
downloadShaarli-9d7a02afcee3c740712a7c95182d332db0504b7e.tar.gz
Shaarli-9d7a02afcee3c740712a7c95182d332db0504b7e.tar.zst
Shaarli-9d7a02afcee3c740712a7c95182d332db0504b7e.zip
Merge branch 'master' into v0.9
Diffstat (limited to 'tests/utils/ReferenceLinkDB.php')
-rw-r--r--tests/utils/ReferenceLinkDB.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/utils/ReferenceLinkDB.php b/tests/utils/ReferenceLinkDB.php
index 1f4b3063..f09eebc1 100644
--- a/tests/utils/ReferenceLinkDB.php
+++ b/tests/utils/ReferenceLinkDB.php
@@ -4,7 +4,7 @@
4 */ 4 */
5class ReferenceLinkDB 5class ReferenceLinkDB
6{ 6{
7 public static $NB_LINKS_TOTAL = 8; 7 public static $NB_LINKS_TOTAL = 9;
8 8
9 private $_links = array(); 9 private $_links = array();
10 private $_publicCount = 0; 10 private $_publicCount = 0;
@@ -38,6 +38,16 @@ class ReferenceLinkDB
38 ); 38 );
39 39
40 $this->addLink( 40 $this->addLink(
41 9,
42 'PSR-2: Coding Style Guide',
43 'http://www.php-fig.org/psr/psr-2/',
44 'This guide extends and expands on PSR-1, the basic coding standard.',
45 0,
46 DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_152312'),
47 ''
48 );
49
50 $this->addLink(
41 8, 51 8,
42 'Free as in Freedom 2.0 @website', 52 'Free as in Freedom 2.0 @website',
43 'https://static.fsf.org/nosvn/faif-2.0.pdf', 53 'https://static.fsf.org/nosvn/faif-2.0.pdf',
@@ -161,6 +171,20 @@ class ReferenceLinkDB
161 return $this->_privateCount; 171 return $this->_privateCount;
162 } 172 }
163 173
174 /**
175 * Returns the number of links without tag
176 */
177 public function countUntaggedLinks()
178 {
179 $cpt = 0;
180 foreach ($this->_links as $link) {
181 if (empty($link['tags'])) {
182 ++$cpt;
183 }
184 }
185 return $cpt;
186 }
187
164 public function getLinks() 188 public function getLinks()
165 { 189 {
166 return $this->_links; 190 return $this->_links;