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

Function TestPrinterPrintStmtTraitUse

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

Source from the content-addressed store, hash-verified

4281}
4282
4283func TestPrinterPrintStmtTraitUse(t *testing.T) {
4284 o := bytes.NewBufferString("")
4285
4286 p := printer.NewPrinter(o)
4287 p.Print(&stmt.TraitUse{
4288 Traits: []node.Node{
4289 &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
4290 &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}},
4291 },
4292 TraitAdaptationList: &stmt.Nop{},
4293 })
4294
4295 expected := `use Foo,Bar;`
4296 actual := o.String()
4297
4298 if expected != actual {
4299 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4300 }
4301}
4302
4303func TestPrinterPrintStmtTraitAdaptations(t *testing.T) {
4304 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…