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

Function TestPrintStaticPropertyFetch

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

Source from the content-addressed store, hash-verified

1945}
1946
1947func TestPrintStaticPropertyFetch(t *testing.T) {
1948 o := bytes.NewBufferString("")
1949
1950 p := printer.NewPrettyPrinter(o, " ")
1951 p.Print(&expr.StaticPropertyFetch{
1952 Class: &node.Identifier{Value: "Foo"},
1953 Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}},
1954 })
1955
1956 expected := `Foo::$bar`
1957 actual := o.String()
1958
1959 if expected != actual {
1960 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1961 }
1962}
1963
1964func TestPrintTernary(t *testing.T) {
1965 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…