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

Function TestPrintPropertyFetch

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

Source from the content-addressed store, hash-verified

1777}
1778
1779func TestPrintPropertyFetch(t *testing.T) {
1780 o := bytes.NewBufferString("")
1781
1782 p := printer.NewPrettyPrinter(o, " ")
1783 p.Print(&expr.PropertyFetch{
1784 Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
1785 Property: &node.Identifier{Value: "bar"},
1786 })
1787
1788 expected := `$foo->bar`
1789 actual := o.String()
1790
1791 if expected != actual {
1792 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1793 }
1794}
1795
1796func TestPrintExprReference(t *testing.T) {
1797 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…