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

Function TestPrinterPrintStmtUnset

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

Source from the content-addressed store, hash-verified

4402}
4403
4404func TestPrinterPrintStmtUnset(t *testing.T) {
4405 o := bytes.NewBufferString("")
4406
4407 p := printer.NewPrinter(o)
4408 p.Print(&stmt.Unset{
4409 Vars: []node.Node{
4410 &expr.Variable{
4411 VarName: &node.Identifier{Value: "a"},
4412 },
4413 &expr.Variable{
4414 VarName: &node.Identifier{Value: "b"},
4415 },
4416 },
4417 })
4418
4419 expected := `unset($a,$b);`
4420 actual := o.String()
4421
4422 if expected != actual {
4423 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4424 }
4425}
4426
4427func TestPrinterPrintStmtUseList(t *testing.T) {
4428 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…