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

Function TestPrinterPrintAssign

printer/printer_test.go:484–503  ·  view source on GitHub ↗

assign

(t *testing.T)

Source from the content-addressed store, hash-verified

482// assign
483
484func TestPrinterPrintAssign(t *testing.T) {
485 o := bytes.NewBufferString("")
486
487 p := printer.NewPrinter(o)
488 p.Print(&assign.Assign{
489 Variable: &expr.Variable{
490 VarName: &node.Identifier{Value: "a"},
491 },
492 Expression: &expr.Variable{
493 VarName: &node.Identifier{Value: "b"},
494 },
495 })
496
497 expected := `$a=$b`
498 actual := o.String()
499
500 if expected != actual {
501 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
502 }
503}
504
505func TestPrinterPrintReference(t *testing.T) {
506 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…