Merge pull request #254 from virtualtam/test/linkdb/datastore
LinkDBTest: only check that the datastore is created and non-empty
This commit is contained in:
commit
eee711c0a8
1 changed files with 4 additions and 10 deletions
|
@ -15,7 +15,6 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
// datastore to test write operations
|
// datastore to test write operations
|
||||||
protected static $testDatastore = 'tests/datastore.php';
|
protected static $testDatastore = 'tests/datastore.php';
|
||||||
protected static $dummyDatastoreFilesize = 759;
|
|
||||||
protected static $refDB = null;
|
protected static $refDB = null;
|
||||||
protected static $publicLinkDB = null;
|
protected static $publicLinkDB = null;
|
||||||
protected static $privateLinkDB = null;
|
protected static $privateLinkDB = null;
|
||||||
|
@ -109,10 +108,7 @@ public function testCheckDBNew()
|
||||||
$this->assertFileExists(self::$testDatastore);
|
$this->assertFileExists(self::$testDatastore);
|
||||||
|
|
||||||
// ensure the correct data has been written
|
// ensure the correct data has been written
|
||||||
$this->assertEquals(
|
$this->assertGreaterThan(0, filesize(self::$testDatastore));
|
||||||
self::$dummyDatastoreFilesize,
|
|
||||||
filesize(self::$testDatastore)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,17 +117,15 @@ public function testCheckDBNew()
|
||||||
public function testCheckDBLoad()
|
public function testCheckDBLoad()
|
||||||
{
|
{
|
||||||
$linkDB = new LinkDB(self::$testDatastore, false, false);
|
$linkDB = new LinkDB(self::$testDatastore, false, false);
|
||||||
$this->assertEquals(
|
$datastoreSize = filesize(self::$testDatastore);
|
||||||
self::$dummyDatastoreFilesize,
|
$this->assertGreaterThan(0, $datastoreSize);
|
||||||
filesize(self::$testDatastore)
|
|
||||||
);
|
|
||||||
|
|
||||||
$checkDB = self::getMethod('checkDB');
|
$checkDB = self::getMethod('checkDB');
|
||||||
$checkDB->invokeArgs($linkDB, array());
|
$checkDB->invokeArgs($linkDB, array());
|
||||||
|
|
||||||
// ensure the datastore is left unmodified
|
// ensure the datastore is left unmodified
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
self::$dummyDatastoreFilesize,
|
$datastoreSize,
|
||||||
filesize(self::$testDatastore)
|
filesize(self::$testDatastore)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue