From d9e636fab0b1c2de36e38e7bdd3498711108a0e6 Mon Sep 17 00:00:00 2001
From: Oleg Pudeyev <oleg@bsdpower.com>
Date: Sat, 1 Dec 2012 18:53:13 -0500
Subject: [PATCH] [ticket/9983] Add a purge test.

PHPBB3-9983
---
 tests/cache/common_test_case.php | 15 +++++++++++++++
 tests/cache/null_driver_test.php |  6 ++++++
 2 files changed, 21 insertions(+)

diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php
index 059ce25133..c44dbf5250 100644
--- a/tests/cache/common_test_case.php
+++ b/tests/cache/common_test_case.php
@@ -21,4 +21,19 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
 			'File ACM put and get'
 		);
 	}
+
+	public function test_purge()
+	{
+		$this->driver->put('test_key', 'test_value');
+
+		$this->assertEquals(
+			'test_value',
+			$this->driver->get('test_key'),
+			'File ACM put and get'
+		);
+
+		$this->driver->purge();
+
+		$this->assertSame(false, $this->driver->get('test_key'));
+	}
 }
diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php
index a9b40c5f40..1e8b254294 100644
--- a/tests/cache/null_driver_test.php
+++ b/tests/cache/null_driver_test.php
@@ -33,6 +33,12 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
 		$this->assertSame(false, $this->driver->get('key'));
 	}
 
+	public function test_purge()
+	{
+		// does nothing
+		$this->driver->purge();
+	}
+
 	public function test_cache_sql()
 	{
 		global $db, $cache;