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

Function TestInstanceOfRelative

node/expr/t_instance_of_test.go:96–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestInstanceOfRelative(t *testing.T) {
97 src := `<? $a instanceof namespace\Foo;`
98
99 expected := &node.Root{
100 Position: &position.Position{
101 StartLine: 1,
102 EndLine: 1,
103 StartPos: 3,
104 EndPos: 31,
105 },
106 Stmts: []node.Node{
107 &stmt.Expression{
108 Position: &position.Position{
109 StartLine: 1,
110 EndLine: 1,
111 StartPos: 3,
112 EndPos: 31,
113 },
114 Expr: &expr.InstanceOf{
115 Position: &position.Position{
116 StartLine: 1,
117 EndLine: 1,
118 StartPos: 3,
119 EndPos: 30,
120 },
121 Expr: &expr.Variable{
122 Position: &position.Position{
123 StartLine: 1,
124 EndLine: 1,
125 StartPos: 3,
126 EndPos: 5,
127 },
128 VarName: &node.Identifier{
129 Position: &position.Position{
130 StartLine: 1,
131 EndLine: 1,
132 StartPos: 3,
133 EndPos: 5,
134 },
135 Value: "a",
136 },
137 },
138 Class: &name.Relative{
139 Position: &position.Position{
140 StartLine: 1,
141 EndLine: 1,
142 StartPos: 17,
143 EndPos: 30,
144 },
145 Parts: []node.Node{
146 &name.NamePart{
147 Position: &position.Position{
148 StartLine: 1,
149 EndLine: 1,
150 StartPos: 27,
151 EndPos: 30,
152 },
153 Value: "Foo",

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…