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

Function TestPrinterPrintPropertyFetch

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

Source from the content-addressed store, hash-verified

2199}
2200
2201func TestPrinterPrintPropertyFetch(t *testing.T) {
2202 o := bytes.NewBufferString("")
2203
2204 p := printer.NewPrinter(o)
2205 p.Print(&expr.PropertyFetch{
2206 Variable: &expr.Variable{
2207 VarName: &node.Identifier{Value: "foo"},
2208 },
2209 Property: &node.Identifier{Value: "bar"},
2210 })
2211
2212 expected := `$foo->bar`
2213 actual := o.String()
2214
2215 if expected != actual {
2216 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2217 }
2218}
2219
2220func TestPrinterPrintExprReference(t *testing.T) {
2221 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…