]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - tests/utils/ReferenceLinkDB.php
3 * Populates a reference datastore to test LinkDB
7 private $_links = array();
8 private $_publicCount = 0;
9 private $_privateCount = 0;
12 * Populates the test DB with reference data
14 function __construct()
17 'Free as in Freedom 2.0',
18 'https://static.fsf.org/nosvn/faif-2.0.pdf',
19 'Richard Stallman and the Free Software Revolution',
22 'free gnu software stallman'
27 'http://mediagoblin.org/',
28 'A free software media publishing platform',
35 'w3c-markup-validator',
36 'https://dvcs.w3.org/hg/markup-validator/summary',
37 'Mercurial repository for the W3C Validator',
40 'css html w3c web Mercurial'
44 'UserFriendly - Web Designer',
45 'http://ars.userfriendly.org/cartoons/?id=20121206',
46 'Naming conventions...',
53 'UserFriendly - Samba',
54 'http://ars.userfriendly.org/cartoons/?id=20010306',
63 'http://geek-and-poke.com/',
74 protected function addLink($title, $url, $description, $private, $date, $tags)
79 'description' => $description,
80 'private' => $private,
84 $this->_links
[$date] = $link;
87 $this->_privateCount++
;
90 $this->_publicCount++
;
94 * Writes data to the datastore
96 public function write($filename)
100 '<?php /* '.base64_encode(gzdeflate(serialize($this->_links
))).' */ ?>'
105 * Returns the number of links in the reference data
107 public function countLinks()
109 return $this->_publicCount +
$this->_privateCount
;
113 * Returns the number of public links in the reference data
115 public function countPublicLinks()
117 return $this->_publicCount
;
121 * Returns the number of private links in the reference data
123 public function countPrivateLinks()
125 return $this->_privateCount
;