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

Function TestPrinterPrintIsset

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

Source from the content-addressed store, hash-verified

1979}
1980
1981func TestPrinterPrintIsset(t *testing.T) {
1982 o := bytes.NewBufferString("")
1983
1984 p := printer.NewPrinter(o)
1985 p.Print(&expr.Isset{
1986 Variables: []node.Node{
1987 &expr.Variable{
1988 VarName: &node.Identifier{Value: "a"},
1989 },
1990 &expr.Variable{
1991 VarName: &node.Identifier{Value: "b"},
1992 },
1993 },
1994 })
1995
1996 expected := `isset($a,$b)`
1997 actual := o.String()
1998
1999 if expected != actual {
2000 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2001 }
2002}
2003
2004func TestPrinterPrintList(t *testing.T) {
2005 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…