(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestSimpleClassMethod(t *testing.T) { |
| 18 | src := `<? class foo{ function bar() {} }` |
| 19 | |
| 20 | expected := &node.Root{ |
| 21 | Position: &position.Position{ |
| 22 | StartLine: 1, |
| 23 | EndLine: 1, |
| 24 | StartPos: 3, |
| 25 | EndPos: 33, |
| 26 | }, |
| 27 | Stmts: []node.Node{ |
| 28 | &stmt.Class{ |
| 29 | Position: &position.Position{ |
| 30 | StartLine: 1, |
| 31 | EndLine: 1, |
| 32 | StartPos: 3, |
| 33 | EndPos: 33, |
| 34 | }, |
| 35 | PhpDocComment: "", |
| 36 | ClassName: &node.Identifier{ |
| 37 | Position: &position.Position{ |
| 38 | StartLine: 1, |
| 39 | EndLine: 1, |
| 40 | StartPos: 9, |
| 41 | EndPos: 12, |
| 42 | }, |
| 43 | Value: "foo", |
| 44 | }, |
| 45 | Stmts: []node.Node{ |
| 46 | &stmt.ClassMethod{ |
| 47 | Position: &position.Position{ |
| 48 | StartLine: 1, |
| 49 | EndLine: 1, |
| 50 | StartPos: 14, |
| 51 | EndPos: 31, |
| 52 | }, |
| 53 | ReturnsRef: false, |
| 54 | PhpDocComment: "", |
| 55 | MethodName: &node.Identifier{ |
| 56 | Position: &position.Position{ |
| 57 | StartLine: 1, |
| 58 | EndLine: 1, |
| 59 | StartPos: 23, |
| 60 | EndPos: 26, |
| 61 | }, |
| 62 | Value: "bar", |
| 63 | }, |
| 64 | Stmt: &stmt.StmtList{ |
| 65 | Position: &position.Position{ |
| 66 | StartLine: 1, |
| 67 | EndLine: 1, |
| 68 | StartPos: 29, |
| 69 | EndPos: 31, |
| 70 | }, |
| 71 | Stmts: []node.Node{}, |
| 72 | }, |
| 73 | }, |
| 74 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…