(t *testing.T)
| 3939 | } |
| 3940 | |
| 3941 | func TestPrinterPrintPropertyList(t *testing.T) { |
| 3942 | o := bytes.NewBufferString("") |
| 3943 | |
| 3944 | p := printer.NewPrinter(o) |
| 3945 | p.Print(&stmt.PropertyList{ |
| 3946 | Modifiers: []node.Node{ |
| 3947 | &node.Identifier{Value: "public"}, |
| 3948 | &node.Identifier{Value: "static"}, |
| 3949 | }, |
| 3950 | Type: &name.Name{ |
| 3951 | Parts: []node.Node{ |
| 3952 | &name.NamePart{ |
| 3953 | Value: "Foo", |
| 3954 | }, |
| 3955 | }, |
| 3956 | }, |
| 3957 | Properties: []node.Node{ |
| 3958 | &stmt.Property{ |
| 3959 | Variable: &expr.Variable{ |
| 3960 | VarName: &node.Identifier{Value: "a"}, |
| 3961 | }, |
| 3962 | Expr: &scalar.String{Value: "'a'"}, |
| 3963 | }, |
| 3964 | &stmt.Property{ |
| 3965 | Variable: &expr.Variable{ |
| 3966 | VarName: &node.Identifier{Value: "b"}, |
| 3967 | }, |
| 3968 | }, |
| 3969 | }, |
| 3970 | }) |
| 3971 | |
| 3972 | expected := `public static Foo $a='a',$b;` |
| 3973 | actual := o.String() |
| 3974 | |
| 3975 | if expected != actual { |
| 3976 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 3977 | } |
| 3978 | } |
| 3979 | |
| 3980 | func TestPrinterPrintProperty(t *testing.T) { |
| 3981 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…