From 0037fbe1e062534ba8d1a19e08f875584cb0ce76 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sun, 28 Jun 2015 14:53:26 +0200 Subject: [PATCH] LinkDBTest: only check that the datastore is created and non-empty Fixes #252 Relates to #238 Signed-off-by: VirtualTam --- tests/LinkDBTest.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index a54fc501..ee8dbee3 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php @@ -15,7 +15,6 @@ class LinkDBTest extends PHPUnit_Framework_TestCase { // datastore to test write operations protected static $testDatastore = 'tests/datastore.php'; - protected static $dummyDatastoreFilesize = 759; protected static $refDB = null; protected static $publicLinkDB = null; protected static $privateLinkDB = null; @@ -109,10 +108,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase $this->assertFileExists(self::$testDatastore); // ensure the correct data has been written - $this->assertEquals( - self::$dummyDatastoreFilesize, - filesize(self::$testDatastore) - ); + $this->assertGreaterThan(0, filesize(self::$testDatastore)); } /** @@ -121,17 +117,15 @@ class LinkDBTest extends PHPUnit_Framework_TestCase public function testCheckDBLoad() { $linkDB = new LinkDB(self::$testDatastore, false, false); - $this->assertEquals( - self::$dummyDatastoreFilesize, - filesize(self::$testDatastore) - ); + $datastoreSize = filesize(self::$testDatastore); + $this->assertGreaterThan(0, $datastoreSize); $checkDB = self::getMethod('checkDB'); $checkDB->invokeArgs($linkDB, array()); // ensure the datastore is left unmodified $this->assertEquals( - self::$dummyDatastoreFilesize, + $datastoreSize, filesize(self::$testDatastore) ); } -- 2.41.0