From: Axel C. K. <ax...@us...> - 2005-12-19 20:18:17
|
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8090/src/net/sourceforge/phpeclipse/tests/parser Modified Files: OverlibTestCase.java SmartyCompilerTestCase.java PHPParserTestCase.java Added Files: ShortTagTestCase.java PHPParserTestSuite.java Log Message: Fix bug #1385272: Parsing of short open tags not fully compatible to PHP parse --- NEW FILE: PHPParserTestSuite.java --- package net.sourceforge.phpeclipse.tests.parser; /******************************************************************************* * 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 ******************************************************************************/ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * PHPeclipse Parser Test Suite * Runs all PHP parser test cases * */ public class PHPParserTestSuite extends TestCase { public PHPParserTestSuite(String name) { super(name); } public static Test suite() { TestSuite suite = new TestSuite("PHPeclipse Parser Test Suite"); suite.addTest(new TestSuite(PHPParserTestCase.class)); suite.addTest(new TestSuite(ShortTagTestCase.class)); suite.addTest(new TestSuite(PHPManualTestCase.class)); suite.addTest(new TestSuite(OverlibTestCase.class)); suite.addTest(new TestSuite(SmartyCompilerTestCase.class)); return suite; } } Index: OverlibTestCase.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/OverlibTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OverlibTestCase.java 2 Sep 2005 19:23:27 -0000 1.3 --- OverlibTestCase.java 19 Dec 2005 20:18:04 -0000 1.4 *************** *** 488,501 **** // parser.phpParserTester(strEval, 1); } - private void checkHTML(String strEval) { - if (Scanner.DEBUG) { - System.out.println("\n------------------------------------"); - System.out.println(strEval); - } - checkParseHTML( - strEval.toCharArray(), - ""); - // parser.phpParserTester(strEval, 1); - } // private void checkHTML(String strEval) { // if (Scanner.DEBUG) { --- 488,491 ---- *************** *** 503,513 **** // System.out.println(strEval); // } ! // parser.parse(strEval); ! // } ! // /** ! // * The JUnit setup method ! // */ ! // protected void setUp() { ! // parser = new Parser(null); // } } --- 493,500 ---- // System.out.println(strEval); // } ! // checkParseHTML( ! // strEval.toCharArray(), ! // ""); ! //// parser.phpParserTester(strEval, 1); // } } Index: SmartyCompilerTestCase.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/SmartyCompilerTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SmartyCompilerTestCase.java 29 Dec 2004 22:18:20 -0000 1.2 --- SmartyCompilerTestCase.java 19 Dec 2005 20:18:04 -0000 1.3 *************** *** 20,1905 **** */ public void testPHPParser() { ! checkHTML("<?php\n" + ! "\n" + ! "/**\n" + ! " * Project: Smarty: the PHP compiling template engine\n" + ! " * File: Smarty_Compiler.class.php\n" + ! " * Author: Monte Ohrt <mo...@is...>\n" + ! " * Andrei Zmievski <an...@ph...>\n" + ! " *\n" + [...3772 lines suppressed...] - checkParseHTML( - 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); - // } } --- 1914,1916 ---- --- NEW FILE: ShortTagTestCase.java --- package net.sourceforge.phpeclipse.tests.parser; /******************************************************************************* * 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 ******************************************************************************/ import net.sourceforge.phpdt.core.tests.util.AbstractCompilerTest; /** * Tests the php parser */ public class ShortTagTestCase extends AbstractCompilerTest { public ShortTagTestCase(String name) { super(name); } /** * Test the PHP Parser with different PHP short tag snippets */ public void testPHPParser() { checkHTML("<?=$var?>"); checkHTML("<?=\"a\"; someOtherPHPCode(); ?>"); checkHTML("<?= \"a\", \"b\" ?> text <?= \"a\", \"b\" ?>"); } } Index: PHPParserTestCase.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPParserTestCase.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PHPParserTestCase.java 13 Oct 2005 19:38:22 -0000 1.11 --- PHPParserTestCase.java 19 Dec 2005 20:18:04 -0000 1.12 *************** *** 224,247 **** } ! private void checkHTML(String strEval) { ! if (Scanner.DEBUG) { ! System.out.println("\n------------------------------------"); ! System.out.println(strEval); ! } ! checkParseHTML(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); ! // } } --- 224,235 ---- } ! // private void checkHTML(String strEval) { ! // if (Scanner.DEBUG) { ! // System.out.println("\n------------------------------------"); ! // System.out.println(strEval); ! // } ! // checkParseHTML(strEval.toCharArray(), ""); ! // // parser.phpParserTester(strEval, 1); ! // } ! } |