From 3917df8bf93287fa1955cf6f770e5870624db5e4 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Mon, 26 Apr 2010 23:29:56 +0200 Subject: [PATCH] Add a test for the cache binder. --- .../Core/test/Horde/Core/Binder/CacheTest.php | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 framework/Core/test/Horde/Core/Binder/CacheTest.php diff --git a/framework/Core/test/Horde/Core/Binder/CacheTest.php b/framework/Core/test/Horde/Core/Binder/CacheTest.php new file mode 100644 index 000000000..a5ca5e6c6 --- /dev/null +++ b/framework/Core/test/Horde/Core/Binder/CacheTest.php @@ -0,0 +1,56 @@ + + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Core + */ + +/** + * Require our basic test case definition + */ +require_once dirname(__FILE__) . '/../Autoload.php'; + +/** + * Test the Cache binder. + * + * Copyright 2009-2010 The Horde Project (http://www.horde.org/) + * + * See the enclosed file COPYING for license information (LGPL). If you + * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. + * + * @category Horde + * @package Core + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Core + */ +class Horde_Core_Binder_CacheTest +extends PHPUnit_Framework_TestCase +{ + public function setUp() + { + $this->injector = new Horde_Injector(new Horde_Injector_TopLevel()); + $this->injector->addBinder( + 'Horde_Cache', + new Horde_Core_Binder_Cache() + ); + } + + public function testInjectorReturnsCache() + { + $GLOBALS['conf']['cache']['driver'] = 'Null'; + $this->assertType( + 'Horde_Cache_Base', + $this->injector->getInstance('Horde_Cache') + ); + } + +} \ No newline at end of file -- 2.11.0