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

Function TestPrinterPrintAssignMod

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

Source from the content-addressed store, hash-verified

671}
672
673func TestPrinterPrintAssignMod(t *testing.T) {
674 o := bytes.NewBufferString("")
675
676 p := printer.NewPrinter(o)
677 p.Print(&assign.Mod{
678 Variable: &expr.Variable{
679 VarName: &node.Identifier{Value: "a"},
680 },
681 Expression: &expr.Variable{
682 VarName: &node.Identifier{Value: "b"},
683 },
684 })
685
686 expected := `$a%=$b`
687 actual := o.String()
688
689 if expected != actual {
690 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
691 }
692}
693
694func TestPrinterPrintAssignMul(t *testing.T) {
695 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…