(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestArrayDimFetch(t *testing.T) { |
| 18 | src := `<? $a[1];` |
| 19 | |
| 20 | expected := &node.Root{ |
| 21 | Position: &position.Position{ |
| 22 | StartLine: 1, |
| 23 | EndLine: 1, |
| 24 | StartPos: 3, |
| 25 | EndPos: 9, |
| 26 | }, |
| 27 | Stmts: []node.Node{ |
| 28 | &stmt.Expression{ |
| 29 | Position: &position.Position{ |
| 30 | StartLine: 1, |
| 31 | EndLine: 1, |
| 32 | StartPos: 3, |
| 33 | EndPos: 9, |
| 34 | }, |
| 35 | Expr: &expr.ArrayDimFetch{ |
| 36 | Position: &position.Position{ |
| 37 | StartLine: 1, |
| 38 | EndLine: 1, |
| 39 | StartPos: 3, |
| 40 | EndPos: 8, |
| 41 | }, |
| 42 | Variable: &expr.Variable{ |
| 43 | Position: &position.Position{ |
| 44 | StartLine: 1, |
| 45 | EndLine: 1, |
| 46 | StartPos: 3, |
| 47 | EndPos: 5, |
| 48 | }, |
| 49 | VarName: &node.Identifier{ |
| 50 | Position: &position.Position{ |
| 51 | StartLine: 1, |
| 52 | EndLine: 1, |
| 53 | StartPos: 3, |
| 54 | EndPos: 5, |
| 55 | }, |
| 56 | Value: "a", |
| 57 | }, |
| 58 | }, |
| 59 | Dim: &scalar.Lnumber{ |
| 60 | Position: &position.Position{ |
| 61 | StartLine: 1, |
| 62 | EndLine: 1, |
| 63 | StartPos: 6, |
| 64 | EndPos: 7, |
| 65 | }, |
| 66 | Value: "1", |
| 67 | }, |
| 68 | }, |
| 69 | }, |
| 70 | }, |
| 71 | } |
| 72 | |
| 73 | php7parser := php7.NewParser([]byte(src), "7.4") |
| 74 | php7parser.Parse() |
nothing calls this directly
no test coverage detected
searching dependent graphs…