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

Function TestPrinterPrintStaticCall

printer/printer_test.go:2364–2393  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2362}
2363
2364func TestPrinterPrintStaticCall(t *testing.T) {
2365 o := bytes.NewBufferString("")
2366
2367 p := printer.NewPrinter(o)
2368 p.Print(&expr.StaticCall{
2369 Class: &node.Identifier{Value: "Foo"},
2370 Call: &node.Identifier{Value: "bar"},
2371 ArgumentList: &node.ArgumentList{
2372 Arguments: []node.Node{
2373 &node.Argument{
2374 Expr: &expr.Variable{
2375 VarName: &node.Identifier{Value: "a"},
2376 },
2377 },
2378 &node.Argument{
2379 Expr: &expr.Variable{
2380 VarName: &node.Identifier{Value: "b"},
2381 },
2382 },
2383 },
2384 },
2385 })
2386
2387 expected := `Foo::bar($a,$b)`
2388 actual := o.String()
2389
2390 if expected != actual {
2391 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2392 }
2393}
2394
2395func TestPrinterPrintStaticPropertyFetch(t *testing.T) {
2396 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…