Skip to content

Commit 23c2845

Browse files
committed
glayzzle#386 - update tests
1 parent 9f22d76 commit 23c2845

File tree

7 files changed

+11
-12
lines changed

7 files changed

+11
-12
lines changed

test/snapshot/arrowfunc.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ describe("arrow function", () => {
1616
expect(
1717
parser.parseEval(`function fn($arg) { return $arg; }`, {
1818
parser: {
19-
php73: true,
20-
php74: false // disable the php 7.4 support
19+
version: "7.3" // disable the php 7.4 support
2120
}
2221
})
2322
).toMatchSnapshot();
@@ -26,7 +25,7 @@ describe("arrow function", () => {
2625
expect(
2726
parser.parseEval(`function fn($arg) { return $arg; }`, {
2827
parser: {
29-
php74: true,
28+
version: "7.4", // enable the php 7.4 support
3029
suppressErrors: true
3130
}
3231
})

test/snapshot/assign.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe("assign", () => {
5555
it("??= (php < 7)", function() {
5656
const astErr = parser.parseEval(`$var ??= $var;`, {
5757
parser: {
58-
php7: false,
58+
version: "5.6",
5959
suppressErrors: true
6060
}
6161
});

test/snapshot/bin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe("bin", () => {
109109
it("?? (php < 7)", function() {
110110
const astErr = parser.parseEval(`$var ?? $var;`, {
111111
parser: {
112-
php7: false,
112+
version: "5.6",
113113
suppressErrors: true
114114
}
115115
});

test/snapshot/byref.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("byref", () => {
1414
expect(
1515
parser.parseEval("$a =& new foo();", {
1616
parser: {
17-
php7: false
17+
version: "5.6"
1818
}
1919
})
2020
).toMatchSnapshot();

test/snapshot/function.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe("Function tests", function() {
5252
it("test reserved word for function name error", function() {
5353
const astErr = parser.parseEval(`function list() {}`, {
5454
parser: {
55-
php7: false,
55+
version: "5.6",
5656
suppressErrors: true
5757
}
5858
});
@@ -67,7 +67,7 @@ describe("Function tests", function() {
6767
it("test arrow function php 7.4", function() {
6868
const astErr = parser.parseEval(`function () {}`, {
6969
parser: {
70-
php74: true,
70+
version: "7.4",
7171
suppressErrors: true
7272
}
7373
});

test/snapshot/php5.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe("Test syntax parsing without PHP7 support", function() {
44
it("special keywords should fail", function() {
55
const ast = parser.parseEval("class foo { function list() { } }", {
66
parser: {
7-
php7: false,
7+
version: "5.6",
88
suppressErrors: true
99
}
1010
});

test/snapshot/php73.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe("Test syntax parsing with PHP 73 support", function() {
66
"[$a, &$b] = $array; list($a, &$b) = $array;",
77
{
88
parser: {
9-
php73: true
9+
version: "7.3"
1010
}
1111
}
1212
);
@@ -42,7 +42,7 @@ describe("Test syntax parsing with PHP 73 support", function() {
4242
`,
4343
{
4444
parser: {
45-
php73: true
45+
version: "7.3"
4646
}
4747
}
4848
);
@@ -66,7 +66,7 @@ describe("Test syntax parsing with PHP 73 support", function() {
6666
`,
6767
{
6868
parser: {
69-
php73: true,
69+
version: "7.3",
7070
suppressErrors: true
7171
}
7272
}

0 commit comments

Comments
 (0)