Start conversion to PHPUnit.
authorGunnar Wrobel <p@rdus.de>
Wed, 1 Dec 2010 16:03:05 +0000 (17:03 +0100)
committerGunnar Wrobel <p@rdus.de>
Wed, 1 Dec 2010 21:10:16 +0000 (22:10 +0100)
framework/Auth/test/Horde/Auth/AllTests.php
framework/Auth/test/Horde/Auth/Autoload.php [new file with mode: 0644]
framework/Auth/test/Horde/Auth/TestCase.php [new file with mode: 0644]
framework/Auth/test/Horde/Auth/Unit/AuthTest.php [new file with mode: 0644]
framework/Auth/test/Horde/Auth/getSalt.phpt [deleted file]

index ce80541..02777bb 100644 (file)
@@ -25,8 +25,19 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
 require_once 'Horde/Test/AllTests.php';
 
 /**
- * @package    Horde_Auth
+ * 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    Auth
  * @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=Auth
  */
 class Horde_Auth_AllTests extends Horde_Test_AllTests
 {
diff --git a/framework/Auth/test/Horde/Auth/Autoload.php b/framework/Auth/test/Horde/Auth/Autoload.php
new file mode 100644 (file)
index 0000000..a5e0b35
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Setup autoloading for the tests.
+ *
+ * PHP version 5
+ *
+ * @category   Horde
+ * @package    Auth
+ * @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=Auth
+ */
+
+require_once 'Horde/Test/Autoload.php';
+
+/** Catch strict standards */
+error_reporting(E_ALL | E_STRICT);
+
+/** Load the basic test definition */
+require_once dirname(__FILE__) . '/TestCase.php';
diff --git a/framework/Auth/test/Horde/Auth/TestCase.php b/framework/Auth/test/Horde/Auth/TestCase.php
new file mode 100644 (file)
index 0000000..91948b7
Binary files /dev/null and b/framework/Auth/test/Horde/Auth/TestCase.php differ
diff --git a/framework/Auth/test/Horde/Auth/Unit/AuthTest.php b/framework/Auth/test/Horde/Auth/Unit/AuthTest.php
new file mode 100644 (file)
index 0000000..f7be745
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Test the Horde_Auth:: class.
+ *
+ * PHP version 5
+ *
+ * @category   Horde
+ * @package    Auth
+ * @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=Auth
+ */
+
+/**
+ * Prepare the test setup.
+ */
+require_once dirname(__FILE__) . '/../Autoload.php';
+
+/**
+ * Test the Horde_Auth:: class.
+ *
+ * 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    Auth
+ * @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=Auth
+ */
+class Horde_Auth_Unit_AuthTest extends Horde_Auth_TestCase
+{
+    /**
+     * @dataProvider getCredentials
+     */
+    public function testGetSalt($encryption, $password, $result)
+    {
+        $this->assertEquals($result, Horde_Auth::getSalt($encryption, $password, 'foobar'));
+    }
+}
\ No newline at end of file
diff --git a/framework/Auth/test/Horde/Auth/getSalt.phpt b/framework/Auth/test/Horde/Auth/getSalt.phpt
deleted file mode 100644 (file)
index 4bc6e27..0000000
Binary files a/framework/Auth/test/Horde/Auth/getSalt.phpt and /dev/null differ