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

Function TestPrinterPrintYieldFrom

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

Source from the content-addressed store, hash-verified

2511}
2512
2513func TestPrinterPrintYieldFrom(t *testing.T) {
2514 o := bytes.NewBufferString("")
2515
2516 p := printer.NewPrinter(o)
2517 p.Print(&expr.YieldFrom{
2518 Expr: &expr.Variable{
2519 VarName: &node.Identifier{Value: "var"},
2520 },
2521 })
2522
2523 expected := `yield from $var`
2524 actual := o.String()
2525
2526 if expected != actual {
2527 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2528 }
2529}
2530
2531func TestPrinterPrintYield(t *testing.T) {
2532 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…