[#82] handle php version
This commit is contained in:
@@ -61,12 +61,12 @@ func TestArray(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)
|
||||
@@ -119,12 +119,12 @@ func TestBool(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)
|
||||
@@ -177,12 +177,12 @@ func TestBoolShort(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)
|
||||
@@ -235,12 +235,12 @@ func TestDouble(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)
|
||||
@@ -293,12 +293,12 @@ func TestCastFloat(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)
|
||||
@@ -351,12 +351,12 @@ func TestInt(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)
|
||||
@@ -409,12 +409,12 @@ func TestIntShort(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)
|
||||
@@ -467,12 +467,12 @@ func TestObject(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)
|
||||
@@ -525,12 +525,12 @@ func TestString(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)
|
||||
@@ -583,12 +583,12 @@ func TestBinaryString(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)
|
||||
@@ -641,12 +641,12 @@ func TestUnset(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