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

Function TestPrinterPrintNamespace

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

Source from the content-addressed store, hash-verified

3888}
3889
3890func TestPrinterPrintNamespace(t *testing.T) {
3891 o := bytes.NewBufferString("")
3892
3893 p := printer.NewPrinter(o)
3894 p.Print(&stmt.Namespace{
3895 NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
3896 })
3897
3898 expected := `namespace Foo;`
3899 actual := o.String()
3900
3901 if expected != actual {
3902 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3903 }
3904}
3905
3906func TestPrinterPrintNamespaceWithStmts(t *testing.T) {
3907 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…