Added PHPUnitEditor and corresponding PHPPreferencePage
[phpeclipse.git] / net.sourceforge.phpeclipse / src / test / PHPParserTestCase2.java
index d921054..b566bf6 100644 (file)
@@ -12,6 +12,7 @@ import org.eclipse.core.runtime.CoreException;
 import junit.framework.TestCase;
 
 import java.io.CharArrayReader;
+import java.io.File;
 
 
 /**
@@ -29,7 +30,7 @@ public class PHPParserTestCase2 extends TestCase {
    *  Test the PHP Parser with different PHP snippets
    */
   public void testPHPParser() {
-    checkHTML("<?php  $a = &$b; ?>");
+    //checkHTML(new File("class.adm_gestuser.php"));
     checkHTML("<?php ec ho 'coucou'; ?>" +
               "\n dfgdfgfdfg" +
               "\n" +
@@ -46,40 +47,6 @@ public class PHPParserTestCase2 extends TestCase {
               "<?php" +
               "\necho ' caca';" +
               "\n?>");
-    checkHTML("<?php" +
-              "\n//if (!isset($AtreidesLanguage)) $AtreidesLanguage='french';" +
-              "\n$AtreidesLanguage='french';" +
-              "\n$for = 1;" +
-              "\n\ninclude_once('php/template.inc');" +
-              "\ninclude ' php/class.PHPLIBTemplateAdaptor.php';" +
-              "\ninclude 'php/class.CachedTemplate.php';" +
-              "\n$_PHPLIB['libdir']='php/';" +
-              "\ninclude 'php/oohforms.inc';" +
-              "\n include 'objet/outil.php';" +
-              "\ninclude 'objet/metier.php';" +
-              "\ninclude 'php/db_mysql.inc';" +
-              "\ninclude 'objet/db5.php';" +
-              "\ninclude 'objet/gui.php';" +
-              "\ninclude 'objet/application.php';" +
-              "\n//----------------------------------------------------" +
-              "\n//                    Objets du site" +
-              "\n//----------------------------------------------------" +
-              "\n//             Objets de base de donnĂ©e" +
-              "\ninclude 'atreides/db_soft.php';" +
-              "\n//             Objets metier" +
-              "\ninclude 'atreides/soft.php';" +
-              "\n//             Objets application" +
-              "\ninclude 'atreides/atreides.php';" +
-              "\n$AtreidesTheme='normal/$AtreidesLanguage';" +
-              "\nif(Vide($oCentral)) $oCentral='Soft';" +
-              "\nif (vide($oModeCentral)) $oModeCentral = 'recherche';" +
-              "\nif (Vide($theme)) $theme='normal';" +
-              "\nif (Vide($mode)) $mode='visu';" +
-              "\n$Atreides=new Atreides($mode,$ini);" +
-              "\n$Atreides->tabAffich['oModeCentral']=$oModeCentral;" +
-              "\nob_start('ob_gzhandler');" +
-              "\necho $Atreides->vueMetier('visu',$AtreidesTheme);" +
-              "\n?>");
     checkHTML("<html>sdfsdf  <?php phpinfo(); ?>");
     checkHTML("\n\n\n\n  <?php print \"Hello world\"?> ");
     checkHTML("<?php phpinfo()?>");
@@ -182,6 +149,17 @@ public class PHPParserTestCase2 extends TestCase {
 
   }
 
+    private void checkHTML(File strEval) {
+    try {
+      System.out.println("strEval = " + strEval.toString());
+      parser.htmlParserTester(strEval);
+    } catch (CoreException e) {
+      e.printStackTrace();
+    } catch (ParseException e) {
+      e.printStackTrace();
+    }
+
+  }
   /**
    *  The JUnit setup method
    */