htdocs/tabber.css -text
htdocs/tabber.js -text
htdocs/top-logo.png -text
+tests/AllTests.php -text
+tests/code/syntax/AllTests.php -text
+tests/code/syntax/SyntaxTests.php -text
+tests/unit/AllTests.php -text
+tests/unit/utils/AllTests.php -text
+tests/unit/utils/UtilsTests.php -text
tools/export-tracker.tcl -text
tools/make-mo.sh -text
tools/update-gettext-files.sh -text
--- /dev/null
+<?php
+if (!defined('PHPUnit_MAIN_METHOD')) {
+ define('PHPUnit_MAIN_METHOD', 'AllTests::main');
+}
+
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+
+// Unit tests
+require_once 'unit/utils/AllTests.php';
+//require_once 'ACL/AllTests.php';
+
+// Code tests
+require_once 'code/syntax/AllTests.php';
+
+// Selenium based tests
+//require_once 'func/Site/AllTests.php';
+//require_once 'func/Trackers/AllTests.php';
+//require_once 'func/Tasks/AllTests.php';
+//require_once 'func/Forums/AllTests.php';
+//require_once 'func/PluginsWiki/AllTests.php';
+//require_once 'func/PluginsWebSvn/AllTests.php';
+//require_once 'func/News/AllTests.php';
+//require_once 'func/scm/AllTests.php';
+//require_once 'func/docs/AllTests.php';
+
+
+class AllTests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('PHPUnit');
+
+ // Unit tests
+ $suite->addTest(Utils_AllTests::suite());
+// $suite->addTest(ACL_AllTests::suite());
+
+ // Code tests
+ $suite->addTest(Syntax_AllTests::suite());
+
+ // Integration tests (Selenium).
+// $suite->addTest(Site_AllTests::suite());
+// $suite->addTest(Trackers_AllTests::suite());
+// $suite->addTest(Tasks_AllTests::suite());
+// $suite->addTest(Forums_AllTests::suite());
+// $suite->addTest(News_AllTests::suite());
+// $suite->addTest(PluginsWiki_AllTests::suite());
+// $suite->addTest(PluginsWebSvn_AllTests::suite());
+// $suite->addTest(Scm_AllTests::suite());
+// $suite->addTest(Docs_AllTests::suite());
+
+ return $suite;
+ }
+}
+
+if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
+ AllTests::main();
+}
+?>
--- /dev/null
+<?php
+require_once 'PHPUnit/Framework.php';
+
+require_once dirname(__FILE__).'/SyntaxTests.php';
+
+class Syntax_AllTests
+{
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('PHPUnit Framework');
+
+ $suite->addTestSuite('Syntax_Tests');
+ // ...
+
+ return $suite;
+ }
+}
+?>
--- /dev/null
+<?php
+
+require_once 'PHPUnit/Framework/TestCase.php';
+
+/**
+ * Simple math test class.
+ *
+ * @package Example
+ * @author Manuel Pichler <mapi@phpundercontrol.org>
+ * @copyright 2007-2008 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 0.4.7
+ * @link http://www.phpundercontrol.org/
+ */
+class Syntax_Tests extends PHPUnit_Framework_TestCase
+{
+ /**
+ * Validate all php code with php -l.
+ */
+ public function testPhpSyntax()
+ {
+ $output = `find ../gforge -name '*.php' -type f -exec php -l {} \; | grep -v '^No syntax errors detected'`;
+ $this->assertEquals('', $output);
+ }
+}
--- /dev/null
+<?php
+if (!defined('PHPUnit_MAIN_METHOD')) {
+ define('PHPUnit_MAIN_METHOD', 'AllTests::main');
+}
+
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+
+// Unit tests
+require_once 'utils/AllTests.php';
+
+class AllTests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('PHPUnit');
+
+ // Unit tests
+ $suite->addTest(Utils_AllTests::suite());
+
+ return $suite;
+ }
+}
+
+if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
+ AllTests::main();
+}
+?>
--- /dev/null
+<?php
+require_once 'PHPUnit/Framework.php';
+
+require_once dirname(__FILE__).'/UtilsTests.php';
+// ...
+
+class Utils_AllTests
+{
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('PHPUnit Framework');
+
+ $suite->addTestSuite('Utils_Tests');
+ // ...
+
+ return $suite;
+ }
+}
+?>
--- /dev/null
+<?php
+
+require_once 'PHPUnit/Framework/TestCase.php';
+require_once dirname(__FILE__) . '/../../../gforge/common/include/utils.php';
+
+/**
+ * Simple math test class.
+ *
+ * @package Example
+ * @author Manuel Pichler <mapi@phpundercontrol.org>
+ * @copyright 2007-2008 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 0.4.7
+ * @link http://www.phpundercontrol.org/
+ */
+class Utils_Tests extends PHPUnit_Framework_TestCase
+{
+ /**
+ * test the validate_email function.
+ */
+ public function testEmail()
+ {
+ $this->assertTrue(validate_email('al@fx.fr'), 'al@fx.fr is a valid email address');
+
+ $this->assertFalse(validate_email('al @fx.fr'), 'al @fx.fr is not a valid email address');
+
+ $this->assertFalse(validate_email('al'), 'al is not a valid email address');
+ }
+
+ /**
+ * test the validate_hostname function.
+ */
+ public function testHostname()
+ {
+ $this->assertTrue(valid_hostname('myhost.com'), 'myhost.com is a valid hostname.');
+
+ $this->assertTrue(valid_hostname('myhost.com.'), 'myhost.com. is a valid hostname.');
+
+ $this->assertFalse(valid_hostname('my host.com'), 'my host.com is not a valid hostname');
+
+ $this->assertFalse(valid_hostname('O@O'), 'O@O is not a valid hostname');
+ }
+}