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

Function TestPrintStaticVar

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

Source from the content-addressed store, hash-verified

3606}
3607
3608func TestPrintStaticVar(t *testing.T) {
3609 o := bytes.NewBufferString("")
3610
3611 p := printer.NewPrettyPrinter(o, " ")
3612 p.Print(&stmt.StaticVar{
3613 Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
3614 Expr: &scalar.Lnumber{Value: "1"},
3615 })
3616
3617 expected := `$a = 1`
3618 actual := o.String()
3619
3620 if expected != actual {
3621 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3622 }
3623}
3624
3625func TestPrintStatic(t *testing.T) {
3626 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…