[Fusionforge-commits] r14668 - trunk/tests/unit/utils

Alain Peyrat aljeux at fusionforge.org
Sun Oct 16 19:32:44 CEST 2011


Author: aljeux
Date: 2011-10-16 19:32:44 +0200 (Sun, 16 Oct 2011)
New Revision: 14668

Modified:
   trunk/tests/unit/utils/UtilsTest.php
Log:
Add one more unit test

Modified: trunk/tests/unit/utils/UtilsTest.php
===================================================================
--- trunk/tests/unit/utils/UtilsTest.php	2011-10-16 17:30:13 UTC (rev 14667)
+++ trunk/tests/unit/utils/UtilsTest.php	2011-10-16 17:32:44 UTC (rev 14668)
@@ -1,7 +1,8 @@
 <?php
 
 require_once 'PHPUnit/Framework/TestCase.php';
-require_once dirname(__FILE__) . '/../../../src/common/include/utils.php';
+require_once dirname(dirname(__FILE__)) . '/../../src/common/include/utils.php';
+require_once dirname(dirname(__FILE__)) . '/../../src/common/include/escapingUtils.php';
 
 /**
  * Simple tests for the utils library.
@@ -40,6 +41,22 @@
 	}
 
 	/**
+	 * test the util_check_url function.
+	 */
+	public function testUtilCheckUrl()
+	{
+		$this->assertTrue(util_check_url('http://fusionforge.org/'), 'http://fusionforge.org/ is a valid URL.');
+
+		$this->assertTrue(util_check_url('https://fusionforge.org/'), 'https://fusionforge.org/ is a valid URL.');
+
+		$this->assertTrue(util_check_url('ftp://fusionforge.org/'), 'ftp://fusionforge.org/ is a valid URL.');
+
+		$this->assertFalse(util_check_url('webdav://toto'), 'webdav://toto is not a valid URL.');
+
+		$this->assertFalse(util_check_url('fusionforge.org'), 'fusionforge.org is not a valid URL');
+	}
+
+	/**
 	 * test the util_strip_accents() function.
 	 */
 	public function testStripAccents()




More information about the Fusionforge-commits mailing list