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

Function TestPrinterPrintExprArrayItem

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

Source from the content-addressed store, hash-verified

1534}
1535
1536func TestPrinterPrintExprArrayItem(t *testing.T) {
1537 o := bytes.NewBufferString("")
1538
1539 p := printer.NewPrinter(o)
1540 p.Print(&expr.ArrayItem{
1541 Val: &expr.Reference{Variable: &expr.Variable{
1542 VarName: &node.Identifier{Value: "world"},
1543 }},
1544 })
1545
1546 expected := `&$world`
1547 actual := o.String()
1548
1549 if expected != actual {
1550 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1551 }
1552}
1553
1554func TestPrinterPrintExprArrayItemUnpack(t *testing.T) {
1555 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…