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

Function TestPrinterPrintExprArrayItemUnpack

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

Source from the content-addressed store, hash-verified

1552}
1553
1554func TestPrinterPrintExprArrayItemUnpack(t *testing.T) {
1555 o := bytes.NewBufferString("")
1556
1557 p := printer.NewPrinter(o)
1558 p.Print(&expr.ArrayItem{
1559 Unpack: true,
1560 Val: &expr.Variable{
1561 VarName: &node.Identifier{Value: "world"},
1562 },
1563 })
1564
1565 expected := `...$world`
1566 actual := o.String()
1567
1568 if expected != actual {
1569 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1570 }
1571}
1572
1573func TestPrinterPrintExprArray(t *testing.T) {
1574 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…