X-Git-Url: http://git.phpeclipse.com
diff --git a/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java b/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java
index fb231ff..3dd624b 100644
--- a/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java
+++ b/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java
@@ -1,6 +1,6 @@
package net.sourceforge.phpeclipse.tests.parser;
/*******************************************************************************
- * Copyright (c) 2002 Klaus Hartlage - www.eclipseproject.de All rights
+ * Copyright (c) 2002 www.phpeclipse.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
@@ -19,6 +19,18 @@ public class PHPManualTestCase extends AbstractCompilerTest {
* Test the PHP Parser with different PHP snippets
*/
public void testPHPParser() {
+ checkPHP("self::$instance = new Singleton();");
+ checkPHP("if ((eregi(\"<[^>]*script*\\\"?[^>]*>\", $secvalue)) ||\r\n" +
+ " (eregi(\"<[^>]*object*\\\"?[^>]*>\", $secvalue)) ||\r\n" +
+ " (eregi(\"<[^>]*iframe*\\\"?[^>]*>\", $secvalue)) ||\r\n" +
+ " (eregi(\"<[^>]*applet*\\\"?[^>]*>\", $secvalue)) ||\r\n" +
+ " (eregi(\"<[^>]*meta*\\\"?[^>]*>\", $secvalue)) ||\r\n" +
+ " (eregi(\"<[^>]*style*\\\"?[^>]*>\", $secvalue)) ||\r\n" +
+ " (eregi(\"<[^>]*form*\\\"?[^>]*>\", $secvalue)) ||\r\n" +
+ " (eregi(\"\\([^>]*\\\"?[^)]*\\)\", $secvalue)) ||\r\n" +
+ " (eregi(\"\\\"\", $secvalue))) {\r\n" +
+ " die (\"
The html tags you attempted to use are not allowed
[ Go Back ]\");\r\n" +
+ " }");
checkPHP("function foo()" + "{" + " echo \"In foo()
\\n\";" + "}"
+ "" + "function bar($arg = '')" + "{"
+ " echo \"In bar(); argument was '$arg'.
\\n\";" + "}" + ""
@@ -123,7 +135,7 @@ public class PHPManualTestCase extends AbstractCompilerTest {
+ "echo 'This will not expand: \\n a newline';\n" + "\n"
+ "// Outputs: Variables do not $expand $either\n"
+ "echo 'Variables do not $expand $either';\n");
-
+
checkPHP("echo \"This works: \" . $arr['foo'][3];");
checkPHP("echo \"\\$foo==$foo; type is \" . gettype ($foo) . \"
\\n\";");
checkPHP("$arr = array(\"foo\" => \"bar\", 12 => true);\n" + "\n"
@@ -193,35 +205,12 @@ public class PHPManualTestCase extends AbstractCompilerTest {
+ "echo $obj->scalar; // outputs 'ciao'");
checkPHP("$var = NULL;");
checkPHP("$var = \"Bob\";\n" + "$Var = \"Joe\";\n"
- + "echo \"$var, $Var\"; // outputs \"Bob, Joe\"\n" + "\n" +
+ + "echo \"$var, $Var\"; // outputs \"Bob, Joe\"\n" + "\n" +
// "$4site = 'not yet'; // invalid; starts with a number\n" +
"$_4site = 'not yet'; // valid; starts with an underscore\n"
+ "$täyte = 'mansikka'; \n");
+
checkPHP("");
checkPHP("");
- checkPHP("");
- }
- private void checkPHP(String strEval) {
- if (Scanner.DEBUG) {
- System.out.println("\n------------------------------------");
- System.out.println(strEval);
- }
- checkParsePHP(
- strEval.toCharArray(),
- "");
-// parser.phpParserTester(strEval, 1);
}
-// private void checkHTML(String strEval) {
-// if (Scanner.DEBUG) {
-// System.out.println("\n------------------------------------");
-// System.out.println(strEval);
-// }
-// parser.parse(strEval);
-// }
- /**
- * The JUnit setup method
- */
-// protected void setUp() {
-// parser = new Parser(null);
-// }
}