(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestPrintNullable(t *testing.T) { |
| 150 | o := bytes.NewBufferString("") |
| 151 | |
| 152 | p := printer.NewPrettyPrinter(o, " ") |
| 153 | p.Print(&node.Nullable{ |
| 154 | Expr: &node.Parameter{ |
| 155 | ByRef: false, |
| 156 | Variadic: true, |
| 157 | VariableType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, |
| 158 | Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, |
| 159 | DefaultValue: &scalar.String{Value: "'default'"}, |
| 160 | }, |
| 161 | }) |
| 162 | |
| 163 | expected := "?\\Foo ...$var = 'default'" |
| 164 | actual := o.String() |
| 165 | |
| 166 | if expected != actual { |
| 167 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestPrintArgument(t *testing.T) { |
| 172 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…