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

Function TestPrinterPrintUnset

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

Source from the content-addressed store, hash-verified

1476}
1477
1478func TestPrinterPrintUnset(t *testing.T) {
1479 o := bytes.NewBufferString("")
1480
1481 p := printer.NewPrinter(o)
1482 p.Print(&cast.Unset{
1483 Expr: &expr.Variable{
1484 VarName: &node.Identifier{Value: "var"},
1485 },
1486 })
1487
1488 expected := `(unset)$var`
1489 actual := o.String()
1490
1491 if expected != actual {
1492 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1493 }
1494}
1495
1496// expr
1497

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…