Ref T4334. See D17802. Currently, PHPAST parser tests are huge blobs of JSON. This is a problem for several reasons:
- The actual numeric constants aren't stable across PHP versions, so these tests can fail for literally no reason.
- No human can hope to read or understand them.
NOTE: This just changes the way we build/run the tests. The next change is the ~15K lines of actual test changes.
Instead, write out the nodes in a nice little tree:
+ n_NODE_NAME + n_SUBNODE + n_ANOTHER_NODE
...and write the tokens in a list:
> T_HELLO hi > T_GOODBYE bye
This isn't a completely exhaustive representation of the tree (parent nodes could still have the wrong token range and be missed by the tests) but I think it's a reasonable balance of readability and stability.