issue #8: update tests

This commit is contained in:
z7zmey 2018-04-10 15:23:13 +03:00
parent 343896d019
commit 6f7834eb6b
76 changed files with 1596 additions and 534 deletions

View File

@ -43,10 +43,14 @@ func TestReference(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -70,10 +74,14 @@ func TestReferenceNew(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -104,10 +112,14 @@ func TestReferenceArgs(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -125,10 +137,14 @@ func TestAssign(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -146,10 +162,14 @@ func TestBitwiseAnd(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -167,10 +187,14 @@ func TestBitwiseOr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -188,10 +212,14 @@ func TestBitwiseXor(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -209,10 +237,14 @@ func TestConcat(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -230,10 +262,14 @@ func TestDiv(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -251,10 +287,14 @@ func TestMinus(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -272,10 +312,14 @@ func TestMod(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -293,10 +337,14 @@ func TestMul(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -314,10 +362,14 @@ func TestPlus(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -335,10 +387,14 @@ func TestPow(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -356,10 +412,14 @@ func TestShiftLeft(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -377,9 +437,13 @@ func TestShiftRight(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -41,10 +41,14 @@ func TestBitwiseAnd(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -62,10 +66,14 @@ func TestBitwiseOr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -83,10 +91,14 @@ func TestBitwiseXor(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -104,10 +116,14 @@ func TestBooleanAnd(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -125,10 +141,14 @@ func TestBooleanOr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -146,7 +166,9 @@ func TestCoalesce(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -164,10 +186,14 @@ func TestConcat(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -185,10 +211,14 @@ func TestDiv(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -206,10 +236,14 @@ func TestEqual(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -227,10 +261,14 @@ func TestGreaterOrEqual(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -248,10 +286,14 @@ func TestGreater(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -269,10 +311,14 @@ func TestIdentical(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -290,10 +336,14 @@ func TestLogicalAnd(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -311,10 +361,14 @@ func TestLogicalOr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -332,10 +386,14 @@ func TestLogicalXor(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -353,10 +411,14 @@ func TestMinus(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -374,10 +436,14 @@ func TestMod(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -395,10 +461,14 @@ func TestMul(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -416,10 +486,14 @@ func TestNotEqual(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -437,10 +511,14 @@ func TestNotIdentical(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -458,10 +536,14 @@ func TestPlus(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -479,10 +561,14 @@ func TestPow(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -500,10 +586,14 @@ func TestShiftLeft(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -521,10 +611,14 @@ func TestShiftRight(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -542,10 +636,14 @@ func TestSmallerOrEqual(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -563,10 +661,14 @@ func TestSmaller(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -584,6 +686,8 @@ func TestSpaceship(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -40,10 +40,14 @@ func TestArray(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -60,10 +64,14 @@ func TestBool(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -80,10 +88,14 @@ func TestBoolShort(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -100,10 +112,14 @@ func TestDouble(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -120,10 +136,14 @@ func TestCastFloat(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -140,10 +160,14 @@ func TestInt(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -160,10 +184,14 @@ func TestIntShort(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -180,10 +208,14 @@ func TestObject(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -200,10 +232,14 @@ func TestString(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -220,9 +256,13 @@ func TestUnset(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -42,10 +42,14 @@ func TestArrayDimFetch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -66,9 +70,13 @@ func TestArrayDimFetchNested(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -27,10 +27,14 @@ func TestArray(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -52,10 +56,14 @@ func TestArrayItem(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -82,9 +90,13 @@ func TestArrayItems(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,9 +25,13 @@ func TestBitwiseNot(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,9 +25,13 @@ func TestBooleanNot(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -32,10 +32,14 @@ func TestClassConstFetch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -53,9 +57,13 @@ func TestStaticClassConstFetch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,10 +25,14 @@ func TestCloneBrackets(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -45,9 +49,13 @@ func TestClone(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -31,10 +31,14 @@ func TestClosure(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -76,10 +80,14 @@ func TestClosureUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -121,10 +129,14 @@ func TestClosureUse2(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -148,6 +160,8 @@ func TestClosureReturnType(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -27,10 +27,14 @@ func TestConstFetch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -47,10 +51,14 @@ func TestConstFetchRelative(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -67,9 +75,13 @@ func TestConstFetchFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,9 +25,13 @@ func TestEmpty(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,9 +25,13 @@ func TestErrorSuppress(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,9 +25,13 @@ func TestEval(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -23,10 +23,14 @@ func TestExit(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -43,10 +47,14 @@ func TestExitExpr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -61,10 +69,14 @@ func TestDie(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -81,9 +93,13 @@ func TestDieExpr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -35,10 +35,14 @@ func TestFunctionCall(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -60,10 +64,14 @@ func TestFunctionCallRelative(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -93,10 +101,14 @@ func TestFunctionFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -122,10 +134,14 @@ func TestFunctionCallVar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -156,9 +172,13 @@ func TestFunctionCallExprArg(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,10 +25,14 @@ func TestPostDec(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -45,10 +49,14 @@ func TestPostInc(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -65,10 +73,14 @@ func TestPreDec(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -85,9 +97,13 @@ func TestPreInc(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,10 +25,14 @@ func TestInclude(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -45,10 +49,14 @@ func TestIncludeOnce(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -65,10 +73,14 @@ func TestRequire(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -85,9 +97,13 @@ func TestRequireOnce(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -32,10 +32,14 @@ func TestInstanceOf(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -57,10 +61,14 @@ func TestInstanceOfRelative(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -82,9 +90,13 @@ func TestInstanceOfFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -27,10 +27,14 @@ func TestIsset(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -50,9 +54,13 @@ func TestIssetVariables(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -30,10 +30,14 @@ func TestEmptyList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -58,10 +62,14 @@ func TestList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -88,10 +96,14 @@ func TestListArrayIndex(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -123,9 +135,13 @@ func TestListList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -27,9 +27,13 @@ func TestMethodCall(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -31,10 +31,14 @@ func TestNew(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -56,10 +60,14 @@ func TestNewRelative(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -81,10 +89,14 @@ func TestNewFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -108,6 +120,8 @@ func TestNewAnonymous(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,9 +25,13 @@ func TestPrint(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -26,9 +26,13 @@ func TestPropertyFetch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -30,9 +30,13 @@ func TestShellExec(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -27,10 +27,14 @@ func TestShortArray(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -52,10 +56,14 @@ func TestShortArrayItem(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -82,9 +90,13 @@ func TestShortArrayItems(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -34,7 +34,9 @@ func TestShortList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -61,7 +63,9 @@ func TestShortListArrayIndex(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -93,6 +97,8 @@ func TestShortListList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -33,10 +33,14 @@ func TestStaticCall(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -59,10 +63,14 @@ func TestStaticCallRelative(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -85,10 +93,14 @@ func TestStaticCallFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -111,10 +123,14 @@ func TestStaticCallVar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -133,9 +149,13 @@ func TestStaticCallVarVar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -31,10 +31,14 @@ func TestStaticPropertyFetch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -56,10 +60,14 @@ func TestStaticPropertyFetchRelative(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -81,9 +89,13 @@ func TestStaticPropertyFetchFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -27,10 +27,14 @@ func TestTernary(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -48,10 +52,14 @@ func TestTernarySimple(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -74,10 +82,14 @@ func TestTernaryNestedTrue(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -100,9 +112,13 @@ func TestTernaryNestedCond(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,10 +25,14 @@ func TestUnaryMinus(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -45,9 +49,13 @@ func TestUnaryPlus(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -23,10 +23,14 @@ func TestVariable(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -41,9 +45,13 @@ func TestVariableVariable(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -24,10 +24,14 @@ func TestYield(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -44,10 +48,14 @@ func TestYieldVal(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -65,10 +73,14 @@ func TestYieldKeyVal(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -85,10 +97,14 @@ func TestYieldExpr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -106,10 +122,14 @@ func TestYieldKeyExpr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -126,6 +146,8 @@ func TestYieldFrom(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -44,10 +44,14 @@ func TestName(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -67,10 +71,14 @@ func TestFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -90,10 +98,14 @@ func TestRelative(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -29,10 +29,14 @@ func TestSimpleVar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -52,10 +56,14 @@ func TestSimpleVarOneChar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -76,10 +84,14 @@ func TestSimpleVarEndsEcapsed(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -100,10 +112,14 @@ func TestStringVarCurveOpen(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -127,10 +143,14 @@ func TestSimpleVarPropertyFetch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -150,10 +170,14 @@ func TestDollarOpenCurlyBraces(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -176,10 +200,14 @@ func TestDollarOpenCurlyBracesDimNumber(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -203,9 +231,13 @@ func TestCurlyOpenMethodCall(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -34,10 +34,14 @@ LBL;
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -62,10 +66,14 @@ LBL;
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -88,10 +96,14 @@ LBL;
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -110,10 +122,14 @@ CAD;
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -136,9 +152,13 @@ CAD;
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -23,9 +23,13 @@ func TestMagicConstant(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -37,10 +37,14 @@ func TestLNumber(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -55,10 +59,14 @@ func TestDNumber(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -73,10 +81,14 @@ func TestFloat(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -91,10 +103,14 @@ func TestBinaryLNumber(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -109,10 +125,14 @@ func TestBinaryDNumber(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -127,10 +147,14 @@ func TestHLNumber(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -145,9 +169,13 @@ func TestHDNumber(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -22,10 +22,14 @@ func TestDoubleQuotedScalarString(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
func TestDoubleQuotedScalarStringWithEscapedVar(t *testing.T) {
@ -39,10 +43,14 @@ func TestDoubleQuotedScalarStringWithEscapedVar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -59,10 +67,14 @@ func TestMultilineDoubleQuotedScalarString(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -77,10 +89,14 @@ func TestSingleQuotedScalarString(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -97,9 +113,13 @@ func TestMultilineSingleQuotedScalarString(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -42,10 +42,14 @@ func TestAltIf(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -71,10 +75,14 @@ func TestAltElseIf(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -97,10 +105,14 @@ func TestAltElse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -135,9 +147,13 @@ func TestAltElseElseIf(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -42,7 +42,9 @@ func TestClassConstList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -73,9 +75,13 @@ func TestClassConstListWithoutModifiers(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -29,10 +29,14 @@ func TestSimpleClassMethod(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -68,10 +72,14 @@ func TestPrivateProtectedClassMethod(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -98,7 +106,9 @@ func TestPhp5ClassMethod(t *testing.T) {
},
}
actual, _, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual := php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -130,7 +140,9 @@ func TestPhp7ClassMethod(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -157,10 +169,14 @@ func TestAbstractClassMethod(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -191,6 +207,8 @@ func TestPhp7AbstractClassMethod(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -24,10 +24,14 @@ func TestSimpleClass(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -46,10 +50,14 @@ func TestAbstractClass(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -73,10 +81,14 @@ func TestClassExtends(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -102,10 +114,14 @@ func TestClassImplement(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -136,10 +152,14 @@ func TestClassImplements(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -176,6 +196,8 @@ func TestAnonimousClass(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -34,9 +34,13 @@ func TestConstList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -28,10 +28,14 @@ func TestContinueEmpty(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -53,10 +57,14 @@ func TestContinueLight(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -78,9 +86,13 @@ func TestContinue(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -30,10 +30,14 @@ func TestDeclare(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -62,10 +66,14 @@ func TestDeclareStmts(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -89,9 +97,13 @@ func TestAltDeclare(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -26,9 +26,13 @@ func TestDo(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -30,10 +30,14 @@ func TestSimpleEcho(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -52,9 +56,13 @@ func TestEcho(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -23,9 +23,13 @@ func TestExpression(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -48,10 +48,14 @@ func TestFor(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -77,9 +81,13 @@ func TestAltFor(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,10 +25,14 @@ func TestForeach(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -45,10 +49,14 @@ func TestForeachExpr(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -65,10 +73,14 @@ func TestAltForeach(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -86,10 +98,14 @@ func TestForeachWithKey(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -107,10 +123,14 @@ func TestForeachExprWithKey(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -129,10 +149,14 @@ func TestForeachWithRef(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -158,9 +182,13 @@ func TestForeachWithList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -28,10 +28,14 @@ func TestSimpleFunction(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -51,10 +55,14 @@ func TestFunctionReturn(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -90,10 +98,14 @@ func TestFunctionReturnVar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -115,10 +127,14 @@ func TestRefFunction(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -141,6 +157,8 @@ func TestReturnTypeFunction(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -25,10 +25,14 @@ func TestGlobal(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -57,9 +61,13 @@ func TestGlobalVars(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -24,9 +24,13 @@ func TestGotoLabel(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -19,9 +19,13 @@ func TestHaltCompiler(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -24,10 +24,14 @@ func TestIf(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -50,10 +54,14 @@ func TestElseIf(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -72,10 +80,14 @@ func TestElse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -104,10 +116,14 @@ func TestElseElseIf(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -138,9 +154,13 @@ func TestElseIfElseIfElse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -20,9 +20,13 @@ func TestInlineHtml(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -24,10 +24,14 @@ func TestInterface(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -51,10 +55,14 @@ func TestInterfaceExtend(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -83,9 +91,13 @@ func TestInterfaceExtends(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -26,10 +26,14 @@ func TestNamespace(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -49,10 +53,14 @@ func TestNamespaceStmts(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -67,9 +75,13 @@ func TestAnonymousNamespace(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -36,10 +36,14 @@ func TestProperty(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -73,10 +77,14 @@ func TestProperties(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -110,9 +118,13 @@ func TestProperties2(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -27,10 +27,14 @@ func TestStaticVar(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -53,10 +57,14 @@ func TestStaticVars(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -79,9 +87,13 @@ func TestStaticVars2(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -42,10 +42,14 @@ func TestAltSwitch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -75,10 +79,14 @@ func TestAltSwitchSemicolon(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -112,10 +120,14 @@ func TestSwitch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -149,9 +161,13 @@ func TestSwitchSemicolon(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -22,9 +22,13 @@ func TestThrow(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -23,9 +23,13 @@ func TestTrait(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -34,10 +34,14 @@ func TestTraitUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -69,10 +73,14 @@ func TestTraitsUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -104,10 +112,14 @@ func TestTraitsUseEmptyAdaptations(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -147,10 +159,14 @@ func TestTraitsUseModifier(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -191,10 +207,14 @@ func TestTraitsUseAliasModifier(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -261,9 +281,13 @@ func TestTraitsUseAdaptions(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -26,10 +26,14 @@ func TestTry(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -61,10 +65,14 @@ func TestTryCatch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -101,7 +109,9 @@ func TestPhp7TryCatch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -146,10 +156,14 @@ func TestTryCatchCatch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -184,10 +198,14 @@ func TestTryCatchFinally(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -243,9 +261,13 @@ func TestTryCatchCatchCatch(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -24,10 +24,14 @@ func TestUnset(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -45,10 +49,14 @@ func TestUnsetVars(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -66,6 +74,8 @@ func TestUnsetTrailingComma(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -30,10 +30,14 @@ func TestSimpleUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -56,10 +60,14 @@ func TestUseFullyQualified(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -83,10 +91,14 @@ func TestUseFullyQualifiedAlias(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -116,10 +128,14 @@ func TestUseList(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -150,10 +166,14 @@ func TestUseListAlias(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -184,10 +204,14 @@ func TestUseListFunctionType(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -220,10 +244,14 @@ func TestUseListFunctionTypeAliases(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -254,10 +282,14 @@ func TestUseListConstType(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -290,10 +322,14 @@ func TestUseListConstTypeAliases(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -328,7 +364,9 @@ func TestGroupUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -364,7 +402,9 @@ func TestGroupUseAlias(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -400,7 +440,9 @@ func TestFunctionGroupUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -436,7 +478,9 @@ func TestConstGroupUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -473,6 +517,8 @@ func TestMixedGroupUse(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -28,10 +28,14 @@ func TestBreakEmpty(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -53,10 +57,14 @@ func TestBreakLight(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -78,9 +86,13 @@ func TestBreak(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -42,10 +42,14 @@ func TestIdentifier(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -135,7 +139,9 @@ func TestPhp7ArgumentNode(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -211,7 +217,9 @@ func TestPhp5ArgumentNode(t *testing.T) {
},
}
actual, _, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual := php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -277,7 +285,9 @@ func TestPhp7ParameterNode(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -343,7 +353,9 @@ func TestPhp5ParameterNode(t *testing.T) {
},
}
actual, _, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual := php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -354,9 +366,13 @@ func TestCommentEndFile(t *testing.T) {
Stmts: []node.Node{},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual = php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -414,6 +414,7 @@ CAD;
`
for n := 0; n < b.N; n++ {
php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
}
}

View File

@ -3615,7 +3615,9 @@ func TestPhp5(t *testing.T) {
},
}
actual, _, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual := php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -3652,7 +3654,9 @@ func TestPhp5Strings(t *testing.T) {
},
}
actual, _, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual := php5parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -3718,6 +3722,8 @@ CAD;
},
}
actual, _, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
php5parser.Parse()
actual := php5parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -382,6 +382,7 @@ CAD;
`
for n := 0; n < b.N; n++ {
php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
}
}

View File

@ -3166,7 +3166,9 @@ func TestPhp7(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -3203,7 +3205,9 @@ func TestPhp5Strings(t *testing.T) {
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}
@ -3269,6 +3273,8 @@ CAD;
},
}
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
actual := php7parser.GetRootNode()
assertEqual(t, expected, actual)
}

View File

@ -22,7 +22,9 @@ func ExampleDumper() {
}
}`
nodes, comments, positions, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
php7parser.Parse()
nodes := php7parser.GetRootNode()
nsResolver := visitor.NewNamespaceResolver()
nodes.Walk(nsResolver)
@ -30,8 +32,8 @@ func ExampleDumper() {
dumper := visitor.Dumper{
Writer: os.Stdout,
Indent: "| ",
Comments: comments,
Positions: positions,
Comments: php7parser.GetComments(),
Positions: php7parser.GetPositions(),
NsResolver: nsResolver,
}
nodes.Walk(dumper)