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

Function TestPrintStmtTraitMethodRef

printer/pretty_printer_test.go:3765–3780  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3763}
3764
3765func TestPrintStmtTraitMethodRef(t *testing.T) {
3766 o := bytes.NewBufferString("")
3767
3768 p := printer.NewPrettyPrinter(o, " ")
3769 p.Print(&stmt.TraitMethodRef{
3770 Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
3771 Method: &node.Identifier{Value: "a"},
3772 })
3773
3774 expected := `Foo::a`
3775 actual := o.String()
3776
3777 if expected != actual {
3778 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3779 }
3780}
3781
3782func TestPrintStmtTraitUseAlias(t *testing.T) {
3783 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…