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

Function TestPrinterPrintExprClassConstFetch

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

Source from the content-addressed store, hash-verified

1641}
1642
1643func TestPrinterPrintExprClassConstFetch(t *testing.T) {
1644 o := bytes.NewBufferString("")
1645
1646 p := printer.NewPrinter(o)
1647 p.Print(&expr.ClassConstFetch{
1648 Class: &expr.Variable{
1649 VarName: &node.Identifier{Value: "var"},
1650 },
1651 ConstantName: &node.Identifier{
1652 Value: "CONST",
1653 },
1654 })
1655
1656 expected := `$var::CONST`
1657 actual := o.String()
1658
1659 if expected != actual {
1660 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1661 }
1662}
1663
1664func TestPrinterPrintExprClone(t *testing.T) {
1665 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…