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

Function TestPrinterPrintExprReference

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

Source from the content-addressed store, hash-verified

2218}
2219
2220func TestPrinterPrintExprReference(t *testing.T) {
2221 o := bytes.NewBufferString("")
2222
2223 p := printer.NewPrinter(o)
2224 p.Print(&expr.Reference{
2225 Variable: &expr.Variable{
2226 VarName: &node.Identifier{Value: "foo"},
2227 },
2228 })
2229
2230 expected := `&$foo`
2231 actual := o.String()
2232
2233 if expected != actual {
2234 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2235 }
2236}
2237
2238func TestPrinterPrintRequire(t *testing.T) {
2239 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…