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

Function TestPrinterPrintStmtTraitMethodRefFull

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

Source from the content-addressed store, hash-verified

4220}
4221
4222func TestPrinterPrintStmtTraitMethodRefFull(t *testing.T) {
4223 o := bytes.NewBufferString("")
4224
4225 p := printer.NewPrinter(o)
4226 p.Print(&stmt.TraitMethodRef{
4227 Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
4228 Method: &node.Identifier{Value: "a"},
4229 })
4230
4231 expected := `Foo::a`
4232 actual := o.String()
4233
4234 if expected != actual {
4235 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4236 }
4237}
4238
4239func TestPrinterPrintStmtTraitUseAlias(t *testing.T) {
4240 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…