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

Function TestPrinterPrintStmtThrow

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

Source from the content-addressed store, hash-verified

4162}
4163
4164func TestPrinterPrintStmtThrow(t *testing.T) {
4165 o := bytes.NewBufferString("")
4166
4167 p := printer.NewPrinter(o)
4168 p.Print(&stmt.Throw{
4169 Expr: &expr.Variable{
4170 VarName: &node.Identifier{Value: "var"},
4171 },
4172 })
4173
4174 expected := `throw $var;`
4175 actual := o.String()
4176
4177 if expected != actual {
4178 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4179 }
4180}
4181
4182func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) {
4183 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…