TestSuite suite = new TestSuite("DOM Parser Tests");
for (final PHPVersion phpVersion : TESTS.keySet()) {
TestSuite phpVerSuite = new TestSuite(phpVersion.getAlias());
final ASTParser newParser = ASTParser.newParser(phpVersion,
ProjectOptions.useShortTags((IProject) null));
for (String testsDirectory : TESTS.get(phpVersion)) {
for (final String fileName : getPDTTFiles(testsDirectory)) {
try {
final PdttFile pdttFile = new PdttFile(fileName);
phpVerSuite.addTest(new DomParserTests(phpVersion
.getAlias() + " - /" + fileName) {
protected void runTest() throws Throwable {
newParser.setSource(pdttFile.getFile().trim()
.toCharArray());
Program program = newParser
.createAST(new NullProgressMonitor());
assertContents(pdttFile.getExpected(),
program.toString());
}