From b0428aa9b02b058b72c40b6e8dc2298d55bf692f Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 23 Jan 2020 21:13:41 +0100 Subject: Migrate cache purge function to a proper class And update dependencies and tests. Note that SESSION['tags'] has been removed a log ago --- tests/feed/CacheTest.php | 92 ------------------------------------------------ 1 file changed, 92 deletions(-) delete mode 100644 tests/feed/CacheTest.php (limited to 'tests/feed') diff --git a/tests/feed/CacheTest.php b/tests/feed/CacheTest.php deleted file mode 100644 index c0a9f26f..00000000 --- a/tests/feed/CacheTest.php +++ /dev/null @@ -1,92 +0,0 @@ -assertFileNotExists(self::$testCacheDir . '/' . $page . '.cache'); - } - - $this->assertFileExists(self::$testCacheDir . '/intru.der'); - } - - /** - * Purge cached pages - missing directory - */ - public function testPurgeCachedPagesMissingDir() - { - $oldlog = ini_get('error_log'); - ini_set('error_log', '/dev/null'); - $this->assertEquals( - 'Cannot purge sandbox/dummycache_missing: no directory', - purgeCachedPages(self::$testCacheDir . '_missing') - ); - ini_set('error_log', $oldlog); - } - - /** - * Purge cached pages and session cache - */ - public function testInvalidateCaches() - { - $this->assertArrayNotHasKey('tags', $_SESSION); - $_SESSION['tags'] = array('goodbye', 'cruel', 'world'); - - invalidateCaches(self::$testCacheDir); - foreach (self::$pages as $page) { - $this->assertFileNotExists(self::$testCacheDir . '/' . $page . '.cache'); - } - - $this->assertArrayNotHasKey('tags', $_SESSION); - } -} -- cgit v1.2.3