Add a test for the cache binder.
authorGunnar Wrobel <p@rdus.de>
Mon, 26 Apr 2010 21:29:56 +0000 (23:29 +0200)
committerGunnar Wrobel <wrobel@temple.(none)>
Tue, 27 Apr 2010 05:34:46 +0000 (07:34 +0200)
framework/Core/test/Horde/Core/Binder/CacheTest.php [new file with mode: 0644]

diff --git a/framework/Core/test/Horde/Core/Binder/CacheTest.php b/framework/Core/test/Horde/Core/Binder/CacheTest.php
new file mode 100644 (file)
index 0000000..a5ca5e6
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Test the Cache binder.
+ *
+ * PHP version 5
+ *
+ * @category   Horde
+ * @package    Core
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @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 <wrobel@pardus.de>
+ * @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