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

Function TestPrinterPrintStatic

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

Source from the content-addressed store, hash-verified

4040}
4041
4042func TestPrinterPrintStatic(t *testing.T) {
4043 o := bytes.NewBufferString("")
4044
4045 p := printer.NewPrinter(o)
4046 p.Print(&stmt.Static{
4047 Vars: []node.Node{
4048 &stmt.StaticVar{
4049 Variable: &expr.Variable{
4050 VarName: &node.Identifier{Value: "a"},
4051 },
4052 },
4053 &stmt.StaticVar{
4054 Variable: &expr.Variable{
4055 VarName: &node.Identifier{Value: "b"},
4056 },
4057 },
4058 },
4059 })
4060
4061 expected := `static$a,$b;`
4062 actual := o.String()
4063
4064 if expected != actual {
4065 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4066 }
4067}
4068
4069func TestPrinterPrintStmtList(t *testing.T) {
4070 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…