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

Function TestClassConstFetch

node/expr/t_class_const_fetch_test.go:19–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestClassConstFetch(t *testing.T) {
20 src := `<? Foo::Bar;`
21
22 expected := &node.Root{
23 Position: &position.Position{
24 StartLine: 1,
25 EndLine: 1,
26 StartPos: 3,
27 EndPos: 12,
28 },
29 Stmts: []node.Node{
30 &stmt.Expression{
31 Position: &position.Position{
32 StartLine: 1,
33 EndLine: 1,
34 StartPos: 3,
35 EndPos: 12,
36 },
37 Expr: &expr.ClassConstFetch{
38 Position: &position.Position{
39 StartLine: 1,
40 EndLine: 1,
41 StartPos: 3,
42 EndPos: 11,
43 },
44 Class: &name.Name{
45 Position: &position.Position{
46 StartLine: 1,
47 EndLine: 1,
48 StartPos: 3,
49 EndPos: 6,
50 },
51 Parts: []node.Node{
52 &name.NamePart{
53 Position: &position.Position{
54 StartLine: 1,
55 EndLine: 1,
56 StartPos: 3,
57 EndPos: 6,
58 },
59 Value: "Foo",
60 },
61 },
62 },
63 ConstantName: &node.Identifier{
64 Position: &position.Position{
65 StartLine: 1,
66 EndLine: 1,
67 StartPos: 8,
68 EndPos: 11,
69 },
70 Value: "Bar",
71 },
72 },
73 },
74 },
75 }
76

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…