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

Function TestPrinterPrintAssignConcat

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

Source from the content-addressed store, hash-verified

608}
609
610func TestPrinterPrintAssignConcat(t *testing.T) {
611 o := bytes.NewBufferString("")
612
613 p := printer.NewPrinter(o)
614 p.Print(&assign.Concat{
615 Variable: &expr.Variable{
616 VarName: &node.Identifier{Value: "a"},
617 },
618 Expression: &expr.Variable{
619 VarName: &node.Identifier{Value: "b"},
620 },
621 })
622
623 expected := `$a.=$b`
624 actual := o.String()
625
626 if expected != actual {
627 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
628 }
629}
630
631func TestPrinterPrintAssignDiv(t *testing.T) {
632 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…