aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cache/cache_test.php
blob: 220fddfd254d33d1a7bf17c11e59a4abed616d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
*
* @package testing
* @version $Id$
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

require_once 'test_framework/framework.php';

class phpbb_cache_test extends phpbb_test_case
{
	protected function tearDown()
	{
		$iterator = new DirectoryIterator('cache/tmp');
		foreach ($iterator as $file)
		{
			if (is_file('cache/tmp/' . $file))
			{
				unlink('cache/tmp/' . $file);
			}
		}
	}

	public function test_acm_file()
	{
		$acm = new phpbb_cache_driver_file('cache/tmp/');
		$acm->put('test_key', 'test_value');
		$acm->save();
		
		$this->assertEquals(
			'test_value',
			$acm->get('test_key'),
			'File ACM put and get'
		);
	}
}