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

Function TestPrinterPrintNameRelative

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

Source from the content-addressed store, hash-verified

310}
311
312func TestPrinterPrintNameRelative(t *testing.T) {
313 o := bytes.NewBufferString("")
314
315 p := printer.NewPrinter(o)
316 p.Print(&name.Relative{
317 Parts: []node.Node{
318 &name.NamePart{
319 Value: "Foo",
320 },
321 &name.NamePart{
322 Value: "Bar",
323 },
324 },
325 })
326
327 expected := "namespace\\Foo\\Bar"
328 actual := o.String()
329
330 if expected != actual {
331 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
332 }
333}
334
335// scalar
336

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…