package test;
+
/**********************************************************************
-Copyright (c) 2002 Klaus Hartlage - www.eclipseproject.de
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
+ Copyright (c) 2002 Klaus Hartlage - www.eclipseproject.de
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Common Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/cpl-v10.html
+ **********************************************************************/
import org.eclipse.core.runtime.CoreException;
*/
public void testPHPParser() {
//checkHTML(new File("class.adm_gestuser.php"));
+ checkHTML("<?php function f($a,$b) {" +
+ "echo $a; } ?>");
checkHTML("<?php ec ho 'coucou'; ?>" +
"\n dfgdfgfdfg" +
"\n" +
checkPHP("$AllowableHTML = array(\"b\"=>1,\n \"i\"=>1);");
checkPHP("if ($term{0}!=$firstChar) {}");
checkPHP(
- "echo \"<center><b>\"._NOADMINYET.\"</b></center><br><br>\"\n"
+ "echo \"<center><b>\"._NOADMINYET.\"</b></center><br><br>\"\n"
+ ".\"<form action=\\\"admin.php\\\" method=\\\"post\\\">\"\n"
+ ".\"<tr><td><b>\"._NICKNAME.\":</b></td><td><input type=\\\"text\\\" name=\\\"name\\\" size=\\\"30\\\" maxlength=\\\"25\\\"></td></tr>\"\n"
+ ";");
checkPHP("if ($arrAtchCookie[1]==0 && $IdAtchPostId!=null){ } ");
checkPHP("$arrAtchCookie[1] -= filesize(realpath($AtchTempDir).\"/\".$xattachlist)/ 1024; ");
checkPHP(
- "if (!isset($message)){ \n"
+ "if (!isset($message)){ \n"
+ "$message = $myrow[post_text];\n"
+ "$message = eregi_replace(\"\\[addsig]\", \"\\n-----------------\\n\" . $myrow[user_sig], $message); \n"
+ "$message = str_replace(\"<BR>\", \"\\n\", $message); \n"
}
}
+
private void checkHTML(String strEval) {
try {
System.out.println("strEval = " + strEval);
}
- private void checkHTML(File strEval) {
+ private void checkHTML(File strEval) {
try {
System.out.println("strEval = " + strEval.toString());
parser.htmlParserTester(strEval);
}
}
+
/**
* The JUnit setup method
*/