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

Function TestPrintExprReference

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

Source from the content-addressed store, hash-verified

1794}
1795
1796func TestPrintExprReference(t *testing.T) {
1797 o := bytes.NewBufferString("")
1798
1799 p := printer.NewPrettyPrinter(o, " ")
1800 p.Print(&expr.Reference{
1801 Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
1802 })
1803
1804 expected := `&$foo`
1805 actual := o.String()
1806
1807 if expected != actual {
1808 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1809 }
1810}
1811
1812func TestPrintRequire(t *testing.T) {
1813 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…