1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

fix: file cache tweaks (#3470)

* fix: improve file cache

* fix(filecache): log when unserialize fails
This commit is contained in:
Dag
2023-06-30 22:31:19 +02:00
committed by GitHub
parent cc91ee1e37
commit 372880b5ef
3 changed files with 45 additions and 13 deletions

View File

@@ -6,6 +6,18 @@ use PHPUnit\Framework\TestCase;
class CacheTest extends TestCase
{
public function testConfig()
{
$sut = new \FileCache(['path' => '/tmp/']);
$this->assertSame(['path' => '/tmp/', 'enable_purge' => true], $sut->getConfig());
$sut = new \FileCache(['path' => '/', 'enable_purge' => false]);
$this->assertSame(['path' => '/', 'enable_purge' => false], $sut->getConfig());
$sut = new \FileCache(['path' => '/tmp', 'enable_purge' => true]);
$this->assertSame(['path' => '/tmp/', 'enable_purge' => true], $sut->getConfig());
}
public function testFileCache()
{
$temporaryFolder = sprintf('%s/rss_bridge_%s/', sys_get_temp_dir(), create_random_string());