MCPcopy Create free account
hub / github.com/z7zmey/php-parser / TestSimpleClassMethod

Function TestSimpleClassMethod

node/stmt/t_class_method_test.go:17–88  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func 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 },

Callers

nothing calls this directly

Calls 4

ParseMethod · 0.95
GetRootNodeMethod · 0.95
NewParserFunction · 0.92
NewParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…