aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--application/LinkDB.php16
-rw-r--r--tests/LinkDBTest.php14
2 files changed, 17 insertions, 13 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php
index ff82446f..a673b086 100644
--- a/application/LinkDB.php
+++ b/application/LinkDB.php
@@ -188,11 +188,15 @@ class LinkDB implements Iterator, Countable, ArrayAccess
188 // Create a dummy database for example 188 // Create a dummy database for example
189 $this->links = array(); 189 $this->links = array();
190 $link = array( 190 $link = array(
191 'title'=>'Shaarli - sebsauvage.net', 191 'title'=>' Shaarli: the personal, minimalist, super-fast, no-database delicious clone',
192 'url'=>'http://sebsauvage.net/wiki/doku.php?id=php:shaarli', 192 'url'=>'https://github.com/shaarli/Shaarli/wiki',
193 'description'=>'Welcome to Shaarli! This is a bookmark. To edit or delete me, you must first login.', 193 'description'=>'Welcome to Shaarli! This is your first public bookmark. To edit or delete me, you must first login.
194
195To learn how to use Shaarli, consult the link "Help/documentation" at the bottom of this page.
196
197You use the community supported version of the original Shaarli project, by Sebastien Sauvage.',
194 'private'=>0, 198 'private'=>0,
195 'linkdate'=>'20110914_190000', 199 'linkdate'=> date('Ymd_His'),
196 'tags'=>'opensource software' 200 'tags'=>'opensource software'
197 ); 201 );
198 $this->links[$link['linkdate']] = $link; 202 $this->links[$link['linkdate']] = $link;
@@ -200,9 +204,9 @@ class LinkDB implements Iterator, Countable, ArrayAccess
200 $link = array( 204 $link = array(
201 'title'=>'My secret stuff... - Pastebin.com', 205 'title'=>'My secret stuff... - Pastebin.com',
202 'url'=>'http://sebsauvage.net/paste/?8434b27936c09649#bR7XsXhoTiLcqCpQbmOpBi3rq2zzQUC5hBI7ZT1O3x8=', 206 'url'=>'http://sebsauvage.net/paste/?8434b27936c09649#bR7XsXhoTiLcqCpQbmOpBi3rq2zzQUC5hBI7ZT1O3x8=',
203 'description'=>'SShhhh!! I\'m a private link only YOU can see. You can delete me too.', 207 'description'=>'Shhhh! I\'m a private link only YOU can see. You can delete me too.',
204 'private'=>1, 208 'private'=>1,
205 'linkdate'=>'20110914_074522', 209 'linkdate'=> date('Ymd_His', strtotime('-1 minute')),
206 'tags'=>'secretstuff' 210 'tags'=>'secretstuff'
207 ); 211 );
208 $this->links[$link['linkdate']] = $link; 212 $this->links[$link['linkdate']] = $link;
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index 0d343359..a54fc501 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -15,7 +15,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
15{ 15{
16 // datastore to test write operations 16 // datastore to test write operations
17 protected static $testDatastore = 'tests/datastore.php'; 17 protected static $testDatastore = 'tests/datastore.php';
18 protected static $dummyDatastoreSHA1 = 'e3edea8ea7bb50be4bcb404df53fbb4546a7156e'; 18 protected static $dummyDatastoreFilesize = 759;
19 protected static $refDB = null; 19 protected static $refDB = null;
20 protected static $publicLinkDB = null; 20 protected static $publicLinkDB = null;
21 protected static $privateLinkDB = null; 21 protected static $privateLinkDB = null;
@@ -110,8 +110,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
110 110
111 // ensure the correct data has been written 111 // ensure the correct data has been written
112 $this->assertEquals( 112 $this->assertEquals(
113 self::$dummyDatastoreSHA1, 113 self::$dummyDatastoreFilesize,
114 sha1_file(self::$testDatastore) 114 filesize(self::$testDatastore)
115 ); 115 );
116 } 116 }
117 117
@@ -122,8 +122,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
122 { 122 {
123 $linkDB = new LinkDB(self::$testDatastore, false, false); 123 $linkDB = new LinkDB(self::$testDatastore, false, false);
124 $this->assertEquals( 124 $this->assertEquals(
125 self::$dummyDatastoreSHA1, 125 self::$dummyDatastoreFilesize,
126 sha1_file(self::$testDatastore) 126 filesize(self::$testDatastore)
127 ); 127 );
128 128
129 $checkDB = self::getMethod('checkDB'); 129 $checkDB = self::getMethod('checkDB');
@@ -131,8 +131,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
131 131
132 // ensure the datastore is left unmodified 132 // ensure the datastore is left unmodified
133 $this->assertEquals( 133 $this->assertEquals(
134 self::$dummyDatastoreSHA1, 134 self::$dummyDatastoreFilesize,
135 sha1_file(self::$testDatastore) 135 filesize(self::$testDatastore)
136 ); 136 );
137 } 137 }
138 138