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

Function TestPrintExprArrayItem

printer/pretty_printer_test.go:1265–1279  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1263}
1264
1265func TestPrintExprArrayItem(t *testing.T) {
1266 o := bytes.NewBufferString("")
1267
1268 p := printer.NewPrettyPrinter(o, " ")
1269 p.Print(&expr.ArrayItem{
1270 Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "world"}}},
1271 })
1272
1273 expected := `&$world`
1274 actual := o.String()
1275
1276 if expected != actual {
1277 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1278 }
1279}
1280
1281func TestPrintExprArray(t *testing.T) {
1282 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…