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

Function TestPrinterPrintVariable

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

Source from the content-addressed store, hash-verified

2493}
2494
2495func TestPrinterPrintVariable(t *testing.T) {
2496 o := bytes.NewBufferString("")
2497
2498 p := printer.NewPrinter(o)
2499 p.Print(&expr.Variable{
2500 VarName: &expr.Variable{
2501 VarName: &node.Identifier{Value: "var"},
2502 },
2503 })
2504
2505 expected := `$$var`
2506 actual := o.String()
2507
2508 if expected != actual {
2509 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2510 }
2511}
2512
2513func TestPrinterPrintYieldFrom(t *testing.T) {
2514 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…