(t *testing.T)
| 4237 | } |
| 4238 | |
| 4239 | func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { |
| 4240 | o := bytes.NewBufferString("") |
| 4241 | |
| 4242 | p := printer.NewPrinter(o) |
| 4243 | p.Print(&stmt.TraitUseAlias{ |
| 4244 | Ref: &stmt.TraitMethodRef{ |
| 4245 | Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, |
| 4246 | Method: &node.Identifier{Value: "a"}, |
| 4247 | }, |
| 4248 | Modifier: &node.Identifier{Value: "public"}, |
| 4249 | Alias: &node.Identifier{Value: "b"}, |
| 4250 | }) |
| 4251 | |
| 4252 | expected := `Foo::a as public b;` |
| 4253 | actual := o.String() |
| 4254 | |
| 4255 | if expected != actual { |
| 4256 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 4257 | } |
| 4258 | } |
| 4259 | |
| 4260 | func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { |
| 4261 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…