tolerant-php-parser icon indicating copy to clipboard operation
tolerant-php-parser copied to clipboard

Add more frameworks to validation test suite

Open mousetraps opened this issue 8 years ago • 4 comments
trafficstars

We continually run tests on:

  • CodeIgniter
  • WordPress
  • cakephp
  • math-php
  • symfony

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>)

mousetraps avatar Jan 17 '17 22:01 mousetraps

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.

mattacosta avatar Jan 19 '17 12:01 mattacosta

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.

mousetraps avatar Jan 20 '17 03:01 mousetraps

@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.

cweagans avatar Jan 24 '17 01:01 cweagans

@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

mousetraps avatar Jan 30 '17 00:01 mousetraps