]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fixes unit tests: checking datastore filesize instead of hash. 238/head
authorArthurHoaro <arthur@hoa.ro>
Wed, 24 Jun 2015 09:47:36 +0000 (11:47 +0200)
committerArthurHoaro <arthur@hoa.ro>
Wed, 24 Jun 2015 09:58:01 +0000 (11:58 +0200)
date() makes the hash validation worthless because it changes at every generation.

tests/LinkDBTest.php

index f67d4d9bdde93d80a582d80644a2e6e493c0876d..3b68dd204639c29ea7c7384041b10c98913d00bc 100644 (file)
@@ -18,7 +18,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
 {
     // datastore to test write operations
     protected static $testDatastore = 'tests/datastore.php';
-    protected static $dummyDatastoreSHA1 = 'e3edea8ea7bb50be4bcb404df53fbb4546a7156e';
+    protected static $dummyDatastoreFilesize = 759;
     protected static $refDB = null;
     protected static $publicLinkDB = null;
     protected static $privateLinkDB = null;
@@ -116,8 +116,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
 
         // ensure the correct data has been written
         $this->assertEquals(
-            self::$dummyDatastoreSHA1,
-            sha1_file(self::$testDatastore)
+            self::$dummyDatastoreFilesize,
+            filesize(self::$testDatastore)
         );
     }
 
@@ -128,8 +128,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     {
         $linkDB = new LinkDB(false, false);
         $this->assertEquals(
-            self::$dummyDatastoreSHA1,
-            sha1_file(self::$testDatastore)
+            self::$dummyDatastoreFilesize,
+            filesize(self::$testDatastore)
         );
 
         $checkDB = self::getMethod('checkDB');
@@ -137,8 +137,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
 
         // ensure the datastore is left unmodified
         $this->assertEquals(
-            self::$dummyDatastoreSHA1,
-            sha1_file(self::$testDatastore)
+            self::$dummyDatastoreFilesize,
+            filesize(self::$testDatastore)
         );
     }