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

Function TestPrinterPrintObject

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

Source from the content-addressed store, hash-verified

1440}
1441
1442func TestPrinterPrintObject(t *testing.T) {
1443 o := bytes.NewBufferString("")
1444
1445 p := printer.NewPrinter(o)
1446 p.Print(&cast.Object{
1447 Expr: &expr.Variable{
1448 VarName: &node.Identifier{Value: "var"},
1449 },
1450 })
1451
1452 expected := `(object)$var`
1453 actual := o.String()
1454
1455 if expected != actual {
1456 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1457 }
1458}
1459
1460func TestPrinterPrintString(t *testing.T) {
1461 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…