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

Function TestStaticCallVarVar

node/expr/t_static_call_test.go:335–416  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

333}
334
335func TestStaticCallVarVar(t *testing.T) {
336 src := `<? $foo::$bar();`
337
338 expected := &node.Root{
339 Position: &position.Position{
340 StartLine: 1,
341 EndLine: 1,
342 StartPos: 3,
343 EndPos: 16,
344 },
345 Stmts: []node.Node{
346 &stmt.Expression{
347 Position: &position.Position{
348 StartLine: 1,
349 EndLine: 1,
350 StartPos: 3,
351 EndPos: 16,
352 },
353 Expr: &expr.StaticCall{
354 Position: &position.Position{
355 StartLine: 1,
356 EndLine: 1,
357 StartPos: 3,
358 EndPos: 15,
359 },
360 Class: &expr.Variable{
361 Position: &position.Position{
362 StartLine: 1,
363 EndLine: 1,
364 StartPos: 3,
365 EndPos: 7,
366 },
367 VarName: &node.Identifier{
368 Position: &position.Position{
369 StartLine: 1,
370 EndLine: 1,
371 StartPos: 3,
372 EndPos: 7,
373 },
374 Value: "foo",
375 },
376 },
377 Call: &expr.Variable{
378 Position: &position.Position{
379 StartLine: 1,
380 EndLine: 1,
381 StartPos: 9,
382 EndPos: 13,
383 },
384 VarName: &node.Identifier{
385 Position: &position.Position{
386 StartLine: 1,
387 EndLine: 1,
388 StartPos: 9,
389 EndPos: 13,
390 },
391 Value: "bar",
392 },

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…