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

Function TestPrinterPrintStaticVar

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

Source from the content-addressed store, hash-verified

4021}
4022
4023func TestPrinterPrintStaticVar(t *testing.T) {
4024 o := bytes.NewBufferString("")
4025
4026 p := printer.NewPrinter(o)
4027 p.Print(&stmt.StaticVar{
4028 Variable: &expr.Variable{
4029 VarName: &node.Identifier{Value: "a"},
4030 },
4031 Expr: &scalar.Lnumber{Value: "1"},
4032 })
4033
4034 expected := `$a=1`
4035 actual := o.String()
4036
4037 if expected != actual {
4038 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4039 }
4040}
4041
4042func TestPrinterPrintStatic(t *testing.T) {
4043 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…