Skip to content

Experiment: Use native php tests #956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8d82aca
Add submodule with php-src.
May 30, 2022
f4aab9e
Merge pull request #941 from czosel/fix-enum-as-identifier-2
MaartenStaa May 30, 2022
fb2f446
3.1.0-beta.9
czosel May 30, 2022
243b0ee
Automatically generate Jest tests from .phpt files in php-src.
May 31, 2022
ca061f4
Handle nuances with whitespace and use statements.
May 31, 2022
12b4813
Start differentiating between namespace_name and name.
May 31, 2022
2cc3fa9
Handle new expression such as `new ('std' . 'Class')`.
May 31, 2022
5b9a744
Handle nullsafe object operator on arbitrary expressions, like `[]?->…
May 31, 2022
c3c8ee4
Mark some tests as throwing a parse error.
May 31, 2022
c1636cd
Disallow static type in argument lists.
May 31, 2022
5ac08bf
Throw error on unterminated multi-line comment.
Jun 2, 2022
af231be
Fix error on variadic function calls.
Jun 7, 2022
424b271
Fix lexing of octal literals.
Jun 8, 2022
1058cad
Move php-src tests to their own files.
Jun 8, 2022
9821921
Fix parsing of enum cases with attributes.
Jun 8, 2022
9ce6b94
Merge pull request #949 from glayzzle/fix-unpacking-multiple-arguments
czosel Jun 10, 2022
71c2a9f
chore: upgrade dependencies
czosel Jun 10, 2022
6736591
Merge pull request #951 from czosel/upgrade-deps
czosel Jun 10, 2022
13cc2b6
3.1.0-beta.10
czosel Jun 10, 2022
bbc70fd
Update php-src test files.
Jun 14, 2022
d66c5c8
Be more conservative about which .phpt files we use.
Jun 14, 2022
c722794
Merge branch 'main' into use-native-php-tests
Jun 14, 2022
b42b8ce
New snapshots after merge.
Jun 14, 2022
8640f86
Mark php-src as failing.
Jun 14, 2022
4dab16d
Mark php-src tests as failing.
Jun 14, 2022
e9ac21e
Mark php-src tests as not failing.
Jun 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update php-src test files.
  • Loading branch information
Maarten Staa committed Jun 14, 2022
commit bbc70fde861baf7c96e4681f1095af99b4a169d5
4 changes: 1 addition & 3 deletions bin/generate-php-src-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ const glob = require("glob");
// described run-time errors, rather than just parse errors.
const testsThatExpectParseErrors = [
"Zend/tests/attributes/019_variable_attribute_name.phpt",
"Zend/tests/bug38779.phpt",
"Zend/tests/bug38779_1.phpt",
"Zend/tests/bug43343.phpt",
"Zend/tests/bug60099.phpt",
"Zend/tests/bug64660.phpt",
"Zend/tests/bug69640.phpt",
"Zend/tests/bug70430.phpt",
"Zend/tests/bug76439_2.phpt",
"Zend/tests/bug77993.phpt",
Expand Down Expand Up @@ -135,6 +132,7 @@ const testsThatExpectParseErrors = [
// These are not parse errors in PHP strictly speaking, but they test syntax
// that is still invalid (i.e. it generates a fatal error).
"Zend/tests/enum/case-in-class.phpt",
"Zend/tests/enum/no-name-property.phpt",
"Zend/tests/readonly_props/readonly_const.phpt",
"Zend/tests/readonly_props/readonly_method.phpt",
"Zend/tests/readonly_props/readonly_method_trait.phpt",
Expand Down
2 changes: 1 addition & 1 deletion test/php-src/Zend-tests-bug38779.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/php-src/Zend-tests-bug38779_1.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/php-src/Zend-tests-bug69640.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ const parser = require("../main");
describe("php-src tests", function () {
// Zend/tests/bug69640.phpt
it("Bug #69640 Unhandled Error thrown from userland do not produce any output", function () {
expect(() => parser.parseCode("<?php\nthrow new \\ParseError('I mess everything up! :trollface:');\n?>")).toThrowErrorMatchingSnapshot();
expect(parser.parseCode("<?php\nthrow new \\ParseError('I mess everything up! :trollface:');\n?>")).toMatchSnapshot();
});
});
2 changes: 1 addition & 1 deletion test/php-src/Zend-tests-enum-no-name-property.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ const parser = require("../main");
describe("php-src tests", function () {
// Zend/tests/enum/no-name-property.phpt
it("Enum disallows name property", function () {
expect(parser.parseCode("<?php\nenum Foo {\n public string $name;\n}\n?>")).toMatchSnapshot();
expect(() => parser.parseCode("<?php\nenum Foo {\n public string $name;\n}\n?>")).toThrowErrorMatchingSnapshot();
});
});
Loading