aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2022-08-06 22:46:28 +0200
committerGravatar GitHub <noreply@github.com> 2022-08-06 22:46:28 +0200
commit2bbce8ebef8cf4f88392431aabe84a15482dc933 (patch)
tree1f5027ca69b1dfa2364bd9319e8536b86a41e928 /tests
parentb042412416cc4ecc71c3f9c13239661a0dd588a6 (diff)
downloadrss-bridge-2bbce8ebef8cf4f88392431aabe84a15482dc933.tar.gz
rss-bridge-2bbce8ebef8cf4f88392431aabe84a15482dc933.tar.zst
rss-bridge-2bbce8ebef8cf4f88392431aabe84a15482dc933.zip
refactor: general code base refactor (#2950)
* refactor * fix: bug in previous refactor * chore: exclude phpcompat sniff due to bug in phpcompat * fix: do not leak absolute paths * refactor/fix: batch extensions checking, fix DOS issue
Diffstat (limited to 'tests')
-rw-r--r--tests/UtilsTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php
index 996886a7..3dd389c6 100644
--- a/tests/UtilsTest.php
+++ b/tests/UtilsTest.php
@@ -16,4 +16,19 @@ final class UtilsTest extends TestCase
$this->assertSame('foo', truncate('foo', 4));
$this->assertSame('fo[...]', truncate('foo', 2, '[...]'));
}
+
+ public function testFileCache()
+ {
+ $sut = new \FileCache();
+ $sut->setScope('scope');
+ $sut->purgeCache(-1);
+ $sut->setKey(['key']);
+
+ $this->assertNull($sut->loadData());
+
+ $sut->saveData('data');
+ $this->assertSame('data', $sut->loadData());
+ $this->assertIsNumeric($sut->getTime());
+ $sut->purgeCache(-1);
+ }
}