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

Function TestPrinterPrintAssignBitwiseAnd

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

Source from the content-addressed store, hash-verified

524}
525
526func TestPrinterPrintAssignBitwiseAnd(t *testing.T) {
527 o := bytes.NewBufferString("")
528
529 p := printer.NewPrinter(o)
530 p.Print(&assign.BitwiseAnd{
531 Variable: &expr.Variable{
532 VarName: &node.Identifier{Value: "a"},
533 },
534 Expression: &expr.Variable{
535 VarName: &node.Identifier{Value: "b"},
536 },
537 })
538
539 expected := `$a&=$b`
540 actual := o.String()
541
542 if expected != actual {
543 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
544 }
545}
546
547func TestPrinterPrintAssignBitwiseOr(t *testing.T) {
548 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…