microsoft / tolerant-php-parser

An early-stage PHP parser designed for IDE usage scenarios.
MIT License
879 stars 80 forks source link

Add more frameworks to validation test suite #10

Open mousetraps opened 7 years ago

mousetraps commented 7 years ago

We continually run tests on:

We should add more frameworks to the list (and feel free to make a PR - to add another submodule: git submodule add <git url> validation/frameworks/<framework-name>)

mattacosta commented 7 years ago

I'd recommend considering Drupal as well. It makes heavy use of namespaces, classes, interfaces, traits, etc. I'm pretty sure the old testing framework still has some legacy functional-style programming in there too.

mousetraps commented 7 years ago

Done! see #24.

BTW, if you want to analyze the failures, the easiest way to do so is to open the tests/output/drupal folder using the syntax visualizer extension after running the validation tests - you'll see error squigglies wherever we fail to parse correctly (presuming the code is indeed valid) and can inspect the adjacent .ast file for more info.
image

Also great call - Drupal is 3x bigger than WordPress, so it'll be a good perf optimization challenge.

cweagans commented 7 years ago

@mousetraps Not sure if you saw or not, but there are a few extra file extensions that you need to look for in the Drupal codebase if you're going to parse every file that contains PHP code. Those extensions are: .theme, .profile, .module, and .engine. There may be a few .test files, but it's possible that those have been removed.

mousetraps commented 7 years ago

@cweagans I did not - thanks for the heads up. Currently it only tests *.php files - https://github.com/Microsoft/tolerant-php-parser/blob/master/tests/ParserFrameworkValidationTests.php#L27