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

Function TestPrinterPrintStaticPropertyFetch

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

Source from the content-addressed store, hash-verified

2393}
2394
2395func TestPrinterPrintStaticPropertyFetch(t *testing.T) {
2396 o := bytes.NewBufferString("")
2397
2398 p := printer.NewPrinter(o)
2399 p.Print(&expr.StaticPropertyFetch{
2400 Class: &node.Identifier{Value: "Foo"},
2401 Property: &expr.Variable{
2402 VarName: &node.Identifier{Value: "bar"},
2403 },
2404 })
2405
2406 expected := `Foo::$bar`
2407 actual := o.String()
2408
2409 if expected != actual {
2410 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2411 }
2412}
2413
2414func TestPrinterPrintTernary(t *testing.T) {
2415 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…