2 /***************************************************************
5 * (c) 2009 Ingo Renner <ingo@typo3.org>
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
27 * Testcase for the abstract cache backend
29 * This file is a backport from FLOW3
31 * @author Ingo Renner <ingo@typo3.org>
36 class t3lib_cache_backend_AbstractBackendTestCase
extends tx_phpunit_testcase
{
39 * @var t3lib_cache_backend_AbstractBackend
45 * @author Robert Lemke <robert@typo3.org>
46 * @author Ingo Renner <ingo@typo3.org>
48 public function setUp() {
49 $className = uniqid('ConcreteBackend_');
51 class ' . $className. ' extends t3lib_cache_backend_AbstractBackend {
52 public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {}
53 public function get($entryIdentifier) {}
54 public function has($entryIdentifier) {}
55 public function remove($entryIdentifier) {}
56 public function flush() {}
57 public function flushByTag($tag) {}
58 public function flushByTags(array $tags) {}
59 public function findIdentifiersByTag($tag) {}
60 public function findIdentifiersByTags(array $tags) {}
61 public function collectGarbage() {}
62 public function setSomeOption($value) {
63 $this->someOption = $value;
65 public function getSomeOption() {
66 return $this->someOption;
70 $this->backend
= new $className();
75 * @author Robert Lemke <robert@typo3.org>
77 public function theConstructorCallsSetterMethodsForAllSpecifiedOptions() {
78 $className = get_class($this->backend
);
79 $backend = new $className(array('someOption' => 'someValue'));
80 $this->assertSame('someValue', $backend->getSomeOption());