*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / test / ParserTester.java
1 package test;
2
3 import junit.framework.TestCase;
4
5
6 /**
7  * A test for my php parser.
8  * to use it you have to switch PHPParser.PARSER_DEBUG to true and you can also switch the debugging flag
9  * of javaCC to true too (you have to regenerate the parser after that)
10  * Please never remove any test. If you find something that my parser do not handle correctly,
11  * you can tell me or add a test here. Thanks
12  * @author Matthieu Casanova
13  */
14 public class ParserTester extends TestCase {
15
16   public void testParser() throws Exception {
17     PHPParser parser = new PHPParser();
18     parser.parseInfo(null,"<?php mysql_query(\"CREATE DATABASE $DB_TABLE\" ) or print 'Error creating database<br>'; ?>");
19     parser.parseInfo(null,"<?php function func($a) {$v1 = $v23;}; ?>");
20     parser.parseInfo(null,"<?php $a = !$b; ?>");
21     parser.parseInfo(null,"<?php $a = @@!!@@@!@coucou(2); ?>");
22     parser.parseInfo(null,"<?php $aname= $out['Name'][$z] = $remote[$j]['Name']; ?>");
23     parser.parseInfo(null,"<?php +$b; ?>");
24     parser.parseInfo(null,"<?php $a = -$b; ?>");
25   }
26 }