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:
parent
598376d4cf
commit
30e6f1ca2f
1 changed files with 7 additions and 7 deletions
|
@ -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 @@ public function testCheckDBNew()
|
|||
|
||||
// ensure the correct data has been written
|
||||
$this->assertEquals(
|
||||
self::$dummyDatastoreSHA1,
|
||||
sha1_file(self::$testDatastore)
|
||||
self::$dummyDatastoreFilesize,
|
||||
filesize(self::$testDatastore)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -128,8 +128,8 @@ public function testCheckDBLoad()
|
|||
{
|
||||
$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 @@ public function testCheckDBLoad()
|
|||
|
||||
// ensure the datastore is left unmodified
|
||||
$this->assertEquals(
|
||||
self::$dummyDatastoreSHA1,
|
||||
sha1_file(self::$testDatastore)
|
||||
self::$dummyDatastoreFilesize,
|
||||
filesize(self::$testDatastore)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue