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

Function TestPrintExprClassConstFetch

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

Source from the content-addressed store, hash-verified

1339}
1340
1341func TestPrintExprClassConstFetch(t *testing.T) {
1342 o := bytes.NewBufferString("")
1343
1344 p := printer.NewPrettyPrinter(o, " ")
1345 p.Print(&expr.ClassConstFetch{
1346 Class: &expr.Variable{VarName: &node.Identifier{Value: "var"}},
1347 ConstantName: &node.Identifier{Value: "CONST"},
1348 })
1349
1350 expected := `$var::CONST`
1351 actual := o.String()
1352
1353 if expected != actual {
1354 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1355 }
1356}
1357
1358func TestPrintExprClone(t *testing.T) {
1359 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…