diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-06-24 11:47:36 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-06-24 11:58:01 +0200 |
commit | 30e6f1ca2f4278f542cde625f8152c7be3551ed4 (patch) | |
tree | 78dbdfdf95517ff5ac7a2d5cfe2c7fbccb8ad476 /tests/LinkDBTest.php | |
parent | 598376d4cfeab52cb7aaefa0d553f74f603bad9b (diff) | |
download | Shaarli-30e6f1ca2f4278f542cde625f8152c7be3551ed4.tar.gz Shaarli-30e6f1ca2f4278f542cde625f8152c7be3551ed4.tar.zst Shaarli-30e6f1ca2f4278f542cde625f8152c7be3551ed4.zip |
Fixes unit tests: checking datastore filesize instead of hash.
date() makes the hash validation worthless because it changes at every generation.
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r-- | tests/LinkDBTest.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index f67d4d9b..3b68dd20 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php | |||
@@ -18,7 +18,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
18 | { | 18 | { |
19 | // datastore to test write operations | 19 | // datastore to test write operations |
20 | protected static $testDatastore = 'tests/datastore.php'; | 20 | protected static $testDatastore = 'tests/datastore.php'; |
21 | protected static $dummyDatastoreSHA1 = 'e3edea8ea7bb50be4bcb404df53fbb4546a7156e'; | 21 | protected static $dummyDatastoreFilesize = 759; |
22 | protected static $refDB = null; | 22 | protected static $refDB = null; |
23 | protected static $publicLinkDB = null; | 23 | protected static $publicLinkDB = null; |
24 | protected static $privateLinkDB = null; | 24 | protected static $privateLinkDB = null; |
@@ -116,8 +116,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
116 | 116 | ||
117 | // ensure the correct data has been written | 117 | // ensure the correct data has been written |
118 | $this->assertEquals( | 118 | $this->assertEquals( |
119 | self::$dummyDatastoreSHA1, | 119 | self::$dummyDatastoreFilesize, |
120 | sha1_file(self::$testDatastore) | 120 | filesize(self::$testDatastore) |
121 | ); | 121 | ); |
122 | } | 122 | } |
123 | 123 | ||
@@ -128,8 +128,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
128 | { | 128 | { |
129 | $linkDB = new LinkDB(false, false); | 129 | $linkDB = new LinkDB(false, false); |
130 | $this->assertEquals( | 130 | $this->assertEquals( |
131 | self::$dummyDatastoreSHA1, | 131 | self::$dummyDatastoreFilesize, |
132 | sha1_file(self::$testDatastore) | 132 | filesize(self::$testDatastore) |
133 | ); | 133 | ); |
134 | 134 | ||
135 | $checkDB = self::getMethod('checkDB'); | 135 | $checkDB = self::getMethod('checkDB'); |
@@ -137,8 +137,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
137 | 137 | ||
138 | // ensure the datastore is left unmodified | 138 | // ensure the datastore is left unmodified |
139 | $this->assertEquals( | 139 | $this->assertEquals( |
140 | self::$dummyDatastoreSHA1, | 140 | self::$dummyDatastoreFilesize, |
141 | sha1_file(self::$testDatastore) | 141 | filesize(self::$testDatastore) |
142 | ); | 142 | ); |
143 | } | 143 | } |
144 | 144 | ||