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

Function TestPrinterPrintArgumentByRef

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

Source from the content-addressed store, hash-verified

224 }
225}
226func TestPrinterPrintArgumentByRef(t *testing.T) {
227 o := bytes.NewBufferString("")
228
229 p := printer.NewPrinter(o)
230 p.Print(&node.Argument{
231 IsReference: true,
232 Variadic: false,
233 Expr: &expr.Variable{
234 VarName: &node.Identifier{
235 Value: "var",
236 },
237 },
238 })
239
240 expected := "&$var"
241 actual := o.String()
242
243 if expected != actual {
244 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
245 }
246}
247
248// name
249

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…