Start test suite.
authorGunnar Wrobel <p@rdus.de>
Mon, 29 Nov 2010 15:41:56 +0000 (16:41 +0100)
committerGunnar Wrobel <p@rdus.de>
Mon, 29 Nov 2010 15:41:56 +0000 (16:41 +0100)
framework/Prefs/test/Horde/Prefs/AllTests.php [new file with mode: 0644]
framework/Prefs/test/Horde/Prefs/Autoload.php [new file with mode: 0644]
framework/Prefs/test/Horde/Prefs/Unit/Storage/FileTest.php [new file with mode: 0644]
framework/Prefs/test/Horde/Prefs/phpunit.xml [new file with mode: 0644]

diff --git a/framework/Prefs/test/Horde/Prefs/AllTests.php b/framework/Prefs/test/Horde/Prefs/AllTests.php
new file mode 100644 (file)
index 0000000..a048fc7
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * All tests for the Horde_Prefs:: package.
+ *
+ * PHP version 5
+ *
+ * @category   Horde
+ * @package    Prefs
+ * @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=Prefs
+ */
+
+/**
+ * Define the main method
+ */
+if (!defined('PHPUnit_MAIN_METHOD')) {
+    define('PHPUnit_MAIN_METHOD', 'Horde_Prefs_AllTests::main');
+}
+
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
+
+/**
+ * Combine the tests for this package.
+ *
+ * Copyright 2007-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    Prefs
+ * @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=Prefs
+ */
+class Horde_Prefs_AllTests extends Horde_Test_AllTests
+{
+}
+
+Horde_Prefs_AllTests::init('Horde_Prefs', __FILE__);
+
+if (PHPUnit_MAIN_METHOD == 'Horde_Prefs_AllTests::main') {
+    Horde_Prefs_AllTests::main();
+}
diff --git a/framework/Prefs/test/Horde/Prefs/Autoload.php b/framework/Prefs/test/Horde/Prefs/Autoload.php
new file mode 100644 (file)
index 0000000..0b2b669
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Setup autoloading for the tests.
+ *
+ * PHP version 5
+ *
+ * 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    Prefs
+ * @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=Prefs
+ */
+
+require_once 'Horde/Test/Autoload.php';
+
+/** Catch strict standards */
+error_reporting(E_ALL | E_STRICT);
diff --git a/framework/Prefs/test/Horde/Prefs/Unit/Storage/FileTest.php b/framework/Prefs/test/Horde/Prefs/Unit/Storage/FileTest.php
new file mode 100644 (file)
index 0000000..310326d
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Test the file based preferences storage backend.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Prefs
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Prefs
+ */
+
+/**
+ * Prepare the test setup.
+ */
+require_once dirname(__FILE__) . '/../../Autoload.php';
+
+/**
+ * Base for session testing.
+ *
+ * Copyright 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  Prefs
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Prefs
+ */
+class Horde_Prefs_Unit_Storage_FileTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @expectedException InvalidArgumentException
+     */
+    public function testMissingDirectory()
+    {
+        $b = new Horde_Prefs_Storage_File('nobody');
+    }
+}
\ No newline at end of file
diff --git a/framework/Prefs/test/Horde/Prefs/phpunit.xml b/framework/Prefs/test/Horde/Prefs/phpunit.xml
new file mode 100644 (file)
index 0000000..502d3c9
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit>
+  <filter>
+    <whitelist>
+      <directory suffix=".php">../../../lib</directory>
+    </whitelist>
+  </filter>
+</phpunit>