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

Function TestPrinterPrintPrint

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

Source from the content-addressed store, hash-verified

2181}
2182
2183func TestPrinterPrintPrint(t *testing.T) {
2184 o := bytes.NewBufferString("")
2185
2186 p := printer.NewPrinter(o)
2187 p.Print(&expr.Print{
2188 Expr: &expr.Variable{
2189 VarName: &node.Identifier{Value: "var"},
2190 },
2191 })
2192
2193 expected := `print $var`
2194 actual := o.String()
2195
2196 if expected != actual {
2197 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2198 }
2199}
2200
2201func TestPrinterPrintPropertyFetch(t *testing.T) {
2202 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…