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

Function TestPrinterPrintBinaryBooleanOr

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

Source from the content-addressed store, hash-verified

883}
884
885func TestPrinterPrintBinaryBooleanOr(t *testing.T) {
886 o := bytes.NewBufferString("")
887
888 p := printer.NewPrinter(o)
889 p.Print(&binary.BooleanOr{
890 Left: &expr.Variable{
891 VarName: &node.Identifier{Value: "a"},
892 },
893 Right: &expr.Variable{
894 VarName: &node.Identifier{Value: "b"},
895 },
896 })
897
898 expected := `$a||$b`
899 actual := o.String()
900
901 if expected != actual {
902 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
903 }
904}
905
906func TestPrinterPrintBinaryCoalesce(t *testing.T) {
907 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…