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

Function TestPrinterPrintExprClosureUse

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

Source from the content-addressed store, hash-verified

1680}
1681
1682func TestPrinterPrintExprClosureUse(t *testing.T) {
1683 o := bytes.NewBufferString("")
1684
1685 p := printer.NewPrinter(o)
1686 p.Print(&expr.ClosureUse{
1687 Uses: []node.Node{
1688 &expr.Reference{Variable: &expr.Variable{
1689 VarName: &node.Identifier{Value: "foo"},
1690 }},
1691 &expr.Variable{
1692 VarName: &node.Identifier{Value: "bar"},
1693 },
1694 },
1695 })
1696
1697 expected := `use(&$foo,$bar)`
1698 actual := o.String()
1699
1700 if expected != actual {
1701 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1702 }
1703}
1704
1705func TestPrinterPrintExprClosure(t *testing.T) {
1706 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…