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

Olivier Berger olberger at libremir.placard.fr.eu.org
Tue Apr 6 17:32:35 CEST 2010


Author: olberger
Date: 2010-04-06 17:32:35 +0200 (Tue, 06 Apr 2010)
New Revision: 9379

Added:
   trunk/tests/unit/utils/HtmlPurifierTest.php
Log:
Add a test to check that htmlpurifier PHP lib is indeed installed on the system running the tests


Added: trunk/tests/unit/utils/HtmlPurifierTest.php
===================================================================
--- trunk/tests/unit/utils/HtmlPurifierTest.php	                        (rev 0)
+++ trunk/tests/unit/utils/HtmlPurifierTest.php	2010-04-06 15:32:35 UTC (rev 9379)
@@ -0,0 +1,34 @@
+<?php
+
+require_once 'PHPUnit/Framework/TestCase.php';
+
+/**
+ * Simple test to check that htmlpurifier is installed
+ *
+ * @package   Tests
+ * @author    Olivier Berger <olivier.berger at it-sudparis.eu>
+ * @copyright 2009 Olivier Berger & Institut TELECOM
+ * @license   GPL License
+ */
+class HtmlPurifier_Tests extends PHPUnit_Framework_TestCase
+{
+	/**
+	 * Test that include of lib doesn't fail, otherwise give some hint on missing package
+	 */
+	public function testHtmlPurifier()
+	{
+	  try {
+	    // cannot test this as fails hard
+	    //require_once('HTMLPurifier.auto.php');
+	    // so include instead :
+	    include 'HTMLPurifier.auto.php';
+	  }
+	  
+	  catch (PHPUnit_Framework_Error $expected) {
+	    $this->fail('You probably need to install htmlpurifier : '.$expected->getMessage());
+            return;
+	  }
+ 	  
+	}
+
+}




More information about the Fusionforge-commits mailing list