Fixes unit tests: checking datastore filesize instead of hash.

date() makes the hash validation worthless because it changes at every generation.
This commit is contained in:
ArthurHoaro 2015-06-24 11:47:36 +02:00
parent 598376d4cf
commit 30e6f1ca2f

View 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)
);
}