[#82] handle php version
This commit is contained in:
@@ -80,12 +80,12 @@ func TestReference(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -165,12 +165,12 @@ func TestReferenceNew(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -287,12 +287,12 @@ func TestReferenceArgs(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -362,12 +362,12 @@ func TestAssign(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -437,12 +437,12 @@ func TestBitwiseAnd(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -512,12 +512,12 @@ func TestBitwiseOr(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -587,12 +587,12 @@ func TestBitwiseXor(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -662,12 +662,12 @@ func TestConcat(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -737,12 +737,12 @@ func TestDiv(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -812,12 +812,12 @@ func TestMinus(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -887,12 +887,12 @@ func TestMod(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -962,12 +962,12 @@ func TestMul(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -1037,12 +1037,12 @@ func TestPlus(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -1112,12 +1112,12 @@ func TestPow(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -1187,12 +1187,12 @@ func TestShiftLeft(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
@@ -1262,12 +1262,12 @@ func TestShiftRight(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
php7parser := php7.NewParser([]byte(src))
|
||||
php7parser := php7.NewParser([]byte(src), "7.4")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
php5parser := php5.NewParser([]byte(src))
|
||||
php5parser := php5.NewParser([]byte(src), "5.6")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assert.DeepEqual(t, expected, actual)
|
||||
|
||||
Reference in New Issue
Block a user