{{ message }}
Experiment: Use native php tests - #956
Draft
MaartenStaa wants to merge 26 commits into
Draft
Conversation
Fixes a parse error when passing multiple argument spreads such as `foo(...$bar, ...$baz)`. Adds extra checks for function definitions with variadic parameters, followed by any other parameters. Fixes #946
Fix error on variadic function calls.
chore: upgrade dependencies
Collaborator
Collaborator
|
@MaartenStaa In the prettier PHP plugin, we're parsing plain php files for snapshot testing using jest setupFiles, thereby avoiding the code generation step: https://github.com/prettier/plugin-php/blob/main/tests_config/run_spec.js |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

@czosel I had an idea the other day. A decent number of the bug reports on this project are due to small correctness issues. So I thought, is there a way to get ahead of the reports, and find them ourselves?
Well, the PHP project itself has many tests (
.phptfiles), so I set up this experiment. I pull in the php-src repository as a submodule, and made a script that generates Jest unit tests from the PHP tests, marking which should fail and which not. This branch and PR are the result.As you can see in the commits, I've already tackled several correctness issues, but there are still plenty of failing tests. I'm jumping the gun and opening the PR to get early feedback for the idea and approach.
List of still failing tests:
Note: it's possible that some of these are beyond the scope of this project, or are cases where the test generator is incorrectly set to expect the test to fail, or doesn't mark a test as one that should fail where it should.