* Testcase for the PHP CodeFormatter
*
* @author Stefan Langer
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class PHPFormatterTest extends TestCase {
private CodeFormatter fFormatter;
indent = Strings.computeIndent(fInitialIndentation, CodeFormatterPreferencePage.getTabSize());
}
String formatedString = fFormatter.format(text, indent, null, lineDelimiter);
- String testResult = "<?php " + lineDelimiter
+ String testResult = "<?php" + lineDelimiter
+ "header(\"Location: http://www.phpeclipse.de/eclipse/space/eclipse/faq/longlinetester\");" + lineDelimiter + "exit;"
+ lineDelimiter + "?>";
junit.framework.Assert.assertEquals(formatedString, testResult);
indent = Strings.computeIndent(fInitialIndentation, CodeFormatterPreferencePage.getTabSize());
}
String formatedString = fFormatter.format(text, indent, null, lineDelimiter);
- String testResult = "<?php " + lineDelimiter + "function test() {" + lineDelimiter + "\techo 'Test!';" + lineDelimiter + "}"
+ String testResult = "<?php" + lineDelimiter + "function test() {" + lineDelimiter + "\techo 'Test!';" + lineDelimiter + "}"
+ lineDelimiter + "?>";
junit.framework.Assert.assertEquals(formatedString, testResult);
}
indent = Strings.computeIndent(fInitialIndentation, CodeFormatterPreferencePage.getTabSize());
}
String formatedString = fFormatter.format(text, indent, null, lineDelimiter);
- String testResult = "<?php " + lineDelimiter + "if (${ $feldname } == $modellvar)" + lineDelimiter + "\t$i = 0;"
+ String testResult = "<?php" + lineDelimiter + "if (${ $feldname } == $modellvar)" + lineDelimiter + "\t$i = 0;"
+ lineDelimiter + "?>";
junit.framework.Assert.assertEquals(formatedString, testResult);
}
indent = Strings.computeIndent(fInitialIndentation, CodeFormatterPreferencePage.getTabSize());
}
String formatedString = fFormatter.format(text, indent, null, lineDelimiter);
- String testResult = "<?php " + lineDelimiter + " " + lineDelimiter + " " + lineDelimiter + "function test() {" + lineDelimiter
+ String testResult = "<?php" + lineDelimiter + "function test() {" + lineDelimiter
+ "\techo 'Test!';" + lineDelimiter + "}" + lineDelimiter + "?>";
junit.framework.Assert.assertEquals(formatedString, testResult);
}