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

Function TestPrinterPrintRequire

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

Source from the content-addressed store, hash-verified

2236}
2237
2238func TestPrinterPrintRequire(t *testing.T) {
2239 o := bytes.NewBufferString("")
2240
2241 p := printer.NewPrinter(o)
2242 p.Print(&expr.Require{
2243 Expr: &scalar.String{Value: "'path'"},
2244 })
2245
2246 expected := `require 'path'`
2247 actual := o.String()
2248
2249 if expected != actual {
2250 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2251 }
2252}
2253
2254func TestPrinterPrintRequireOnce(t *testing.T) {
2255 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…