* All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is * free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * Testcase for the abstract cache backend * * This file is a backport from FLOW3 * * @author Ingo Renner * @package TYPO3 * @subpackage tests * @version $Id$ */ class t3lib_cache_backend_AbstractBackendTestCase extends tx_phpunit_testcase { /** * @var t3lib_cache_backend_AbstractBackend */ protected $backend; /** * @return void * @author Robert Lemke * @author Ingo Renner */ public function setUp() { $className = uniqid('ConcreteBackend_'); eval(' class ' . $className. ' extends t3lib_cache_backend_AbstractBackend { public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {} public function get($entryIdentifier) {} public function has($entryIdentifier) {} public function remove($entryIdentifier) {} public function flush() {} public function flushByTag($tag) {} public function flushByTags(array $tags) {} public function findIdentifiersByTag($tag) {} public function findIdentifiersByTags(array $tags) {} public function collectGarbage() {} public function setSomeOption($value) { $this->someOption = $value; } public function getSomeOption() { return $this->someOption; } } '); $this->backend = new $className(); } /** * @test * @author Robert Lemke */ public function theConstructorCallsSetterMethodsForAllSpecifiedOptions() { $className = get_class($this->backend); $backend = new $className(array('someOption' => 'someValue')); $this->assertSame('someValue', $backend->getSomeOption()); } } ?>