1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 10:16:36 +02:00

[task/acm-refactor] Cleaning up left over mentions of ACM and fixing tests.

PHPBB3-9983
This commit is contained in:
Nils Adermann
2011-01-09 21:09:56 +01:00
committed by Igor Wiedler
parent 9329b16ab1
commit 1aef7eb20e
13 changed files with 76 additions and 117 deletions

View File

@@ -1,40 +0,0 @@
<?php
/**
*
* @package testing
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('PHPUnit_MAIN_METHOD'))
{
define('PHPUnit_MAIN_METHOD', 'phpbb_request_all_tests::main');
}
require_once 'test_framework/framework.php';
require_once 'PHPUnit/TextUI/TestRunner.php';
require_once 'cache/cache_test.php';
class phpbb_cache_all_tests
{
public static function main()
{
PHPUnit_TextUI_TestRunner::run(self::suite());
}
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('phpBB Cache System');
$suite->addTestSuite('phpbb_cache_test');
return $suite;
}
}
if (PHPUnit_MAIN_METHOD == 'phpbb_cache_all_tests::main')
{
phpbb_cache_all_tests::main();
}

View File

@@ -2,37 +2,39 @@
/**
*
* @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';
require_once __DIR__ . '/../../phpBB/includes/functions.php';
class phpbb_cache_test extends phpbb_test_case
{
protected function tearDown()
{
$iterator = new DirectoryIterator('cache/tmp');
$iterator = new DirectoryIterator(__DIR__ . '/tmp');
foreach ($iterator as $file)
{
if (is_file('cache/tmp/' . $file))
if (is_file(__DIR__ . '/tmp/' . $file) && $file != '.gitkeep')
{
unlink('cache/tmp/' . $file);
unlink(__DIR__ . '/tmp/' . $file);
}
}
}
public function test_acm_file()
public function test_cache_driver_file()
{
$acm = new phpbb_cache_driver_file('cache/tmp/');
$acm->put('test_key', 'test_value');
$acm->save();
global $phpEx;
$phpEx = 'txt'; // do not store files as .php
$driver = new phpbb_cache_driver_file(__DIR__ . '/tmp/');
$driver->put('test_key', 'test_value');
$driver->save();
$this->assertEquals(
'test_value',
$acm->get('test_key'),
$driver->get('test_key'),
'File ACM put and get'
);
}

0
tests/cache/tmp/.gitkeep vendored Normal file
View File