diff options
author | VirtualTam <virtualtam@flibidi.net> | 2015-07-09 22:14:39 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2015-08-13 23:48:06 +0200 |
commit | 01e48f269df59e02798dad4a698c125d76b0ed70 (patch) | |
tree | 9341487badd4ed14e0104ae338cf48c4ee0dc994 /tests/LinkDBTest.php | |
parent | 5ac5349ac053b1e560b136c62f8c764fd3230039 (diff) | |
download | Shaarli-01e48f269df59e02798dad4a698c125d76b0ed70.tar.gz Shaarli-01e48f269df59e02798dad4a698c125d76b0ed70.tar.zst Shaarli-01e48f269df59e02798dad4a698c125d76b0ed70.zip |
CachedPage: move to a proper file, add tests
Modifications
- rename `pageCache` to `CachedPage`
- move utilities to `Cache`
- do not access globals
- apply coding rules
- update LinkDB and test code
- add test coverage
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r-- | tests/LinkDBTest.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index 504c8190..451f1d6f 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php | |||
@@ -3,6 +3,7 @@ | |||
3 | * Link datastore tests | 3 | * Link datastore tests |
4 | */ | 4 | */ |
5 | 5 | ||
6 | require_once 'application/Cache.php'; | ||
6 | require_once 'application/LinkDB.php'; | 7 | require_once 'application/LinkDB.php'; |
7 | require_once 'application/Utils.php'; | 8 | require_once 'application/Utils.php'; |
8 | require_once 'tests/utils/ReferenceLinkDB.php'; | 9 | require_once 'tests/utils/ReferenceLinkDB.php'; |
@@ -180,11 +181,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
180 | 'tags'=>'unit test' | 181 | 'tags'=>'unit test' |
181 | ); | 182 | ); |
182 | $testDB[$link['linkdate']] = $link; | 183 | $testDB[$link['linkdate']] = $link; |
183 | 184 | $testDB->savedb('tests'); | |
184 | // TODO: move PageCache to a proper class/file | ||
185 | function invalidateCaches() {} | ||
186 | |||
187 | $testDB->savedb(); | ||
188 | 185 | ||
189 | $testDB = new LinkDB(self::$testDatastore, true, false); | 186 | $testDB = new LinkDB(self::$testDatastore, true, false); |
190 | $this->assertEquals($dbSize + 1, sizeof($testDB)); | 187 | $this->assertEquals($dbSize + 1, sizeof($testDB)); |
@@ -514,4 +511,3 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
514 | ); | 511 | ); |
515 | } | 512 | } |
516 | } | 513 | } |
517 | ?> | ||