aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-06-28 14:53:26 +0200
committerVirtualTam <virtualtam@flibidi.net>2015-06-28 14:53:26 +0200
commit0037fbe1e062534ba8d1a19e08f875584cb0ce76 (patch)
treeba9a06a87cc96e6fcc15322bcd04e911a9ea0ac3 /tests
parentfe4e8839b3d1ec8d34557e0e54bac2ae9c1bda8f (diff)
downloadShaarli-0037fbe1e062534ba8d1a19e08f875584cb0ce76.tar.gz
Shaarli-0037fbe1e062534ba8d1a19e08f875584cb0ce76.tar.zst
Shaarli-0037fbe1e062534ba8d1a19e08f875584cb0ce76.zip
LinkDBTest: only check that the datastore is created and non-empty
Fixes #252 Relates to #238 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/LinkDBTest.php14
1 files 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
15{ 15{
16 // datastore to test write operations 16 // datastore to test write operations
17 protected static $testDatastore = 'tests/datastore.php'; 17 protected static $testDatastore = 'tests/datastore.php';
18 protected static $dummyDatastoreFilesize = 759;
19 protected static $refDB = null; 18 protected static $refDB = null;
20 protected static $publicLinkDB = null; 19 protected static $publicLinkDB = null;
21 protected static $privateLinkDB = null; 20 protected static $privateLinkDB = null;
@@ -109,10 +108,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
109 $this->assertFileExists(self::$testDatastore); 108 $this->assertFileExists(self::$testDatastore);
110 109
111 // ensure the correct data has been written 110 // ensure the correct data has been written
112 $this->assertEquals( 111 $this->assertGreaterThan(0, filesize(self::$testDatastore));
113 self::$dummyDatastoreFilesize,
114 filesize(self::$testDatastore)
115 );
116 } 112 }
117 113
118 /** 114 /**
@@ -121,17 +117,15 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
121 public function testCheckDBLoad() 117 public function testCheckDBLoad()
122 { 118 {
123 $linkDB = new LinkDB(self::$testDatastore, false, false); 119 $linkDB = new LinkDB(self::$testDatastore, false, false);
124 $this->assertEquals( 120 $datastoreSize = filesize(self::$testDatastore);
125 self::$dummyDatastoreFilesize, 121 $this->assertGreaterThan(0, $datastoreSize);
126 filesize(self::$testDatastore)
127 );
128 122
129 $checkDB = self::getMethod('checkDB'); 123 $checkDB = self::getMethod('checkDB');
130 $checkDB->invokeArgs($linkDB, array()); 124 $checkDB->invokeArgs($linkDB, array());
131 125
132 // ensure the datastore is left unmodified 126 // ensure the datastore is left unmodified
133 $this->assertEquals( 127 $this->assertEquals(
134 self::$dummyDatastoreFilesize, 128 $datastoreSize,
135 filesize(self::$testDatastore) 129 filesize(self::$testDatastore)
136 ); 130 );
137 } 131 }